sveltejs / eslint-plugin-svelte3

An ESLint plugin for Svelte v3 components.
MIT License
373 stars 44 forks source link

variable was used before it was defined (eslint: no-use-before-define) #182

Open axelthat opened 2 years ago

axelthat commented 2 years ago
Screen Shot 2022-05-09 at 8 32 24 AM

.eslintrc.cjs

module.exports = {
  env: {
    browser: true,
    es2021: true,
    node: true
  },
  extends: [
    'eslint:recommended',
    'plugin:@typescript-eslint/recommended',
    'plugin:@typescript-eslint/recommended-requiring-type-checking',
    'standard'
  ],
  parser: '@typescript-eslint/parser',
  parserOptions: {
    ecmaVersion: 'latest',
    sourceType: 'module',
    project: ['./tsconfig.json'],
    extraFileExtensions: ['.svelte', '.cjs']
  },
  plugins: ['@typescript-eslint', 'svelte3'],
  overrides: [
    {
      files: ['*.svelte'],
      processor: 'svelte3/svelte3'
    }
  ],
  settings: {
    'svelte3/typescript': () => require('typescript')
  },
  rules: {
    'no-multiple-empty-lines': ['error', { max: 1, maxBOF: 2, maxEOF: 0 }] // standard
  }
}
florestankorp commented 2 years ago

Same here. The plugin should understand that I'm in a Svelte project, no?

Razunter commented 1 year ago

I'm getting this in App.svelte, but not in other .svelte files, weird.