Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Missing trailing comma." error in HTML element when use semi: never #122

Open
ngaer opened this issue Jul 14, 2021 · 0 comments
Open

"Missing trailing comma." error in HTML element when use semi: never #122

ngaer opened this issue Jul 14, 2021 · 0 comments

Comments

@ngaer
Copy link

ngaer commented Jul 14, 2021

I'm getting "Missing trailing comma. (comma-dangle)" errors in HTML element property in several different places. E.g.

<script lang="ts">
  export let size: 'large' | 'small' = 'small'
  export let color = '#3F3F3F'
</script>

<div class={`spinner ${size}`}>
  {#each Array(8) as _, __}
    <div />
  {/each}
</div>

And here's error:

Screen Shot 2021-07-14 at 15 40 07

.eslintrc.js file:

module.exports = {
  root: true,
  parser: '@typescript-eslint/parser',
  plugins: [
    'svelte3',
    '@typescript-eslint',
  ],
  env: {
    node: true,
    browser: true,
  },
  extends: [
    'eslint:recommended',
    'plugin:@typescript-eslint/eslint-recommended',
    'plugin:@typescript-eslint/recommended',
    'standard',
  ],
  overrides: [{
    files: ['*.svelte'],
    processor: 'svelte3/svelte3',
  }],
  settings: {
    'svelte3/typescript': true,
    'svelte3/ignore-styles': () => true,
  },
  rules: {
    '@typescript-eslint/no-non-null-assertion': 0,
    '@typescript-eslint/no-explicit-any': 0,
    'no-multiple-empty-lines': ['error', { max: 1, maxBOF: 2, maxEOF: 0 }],
    'comma-dangle': ['error', 'always-multiline'],
  },
}

If I will put a semicolon at the end TS code, the error disappears. So it seems to be related to having both semi:never and comma-dangle: always at the same time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant