sveltejs / eslint-plugin-svelte3

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

Error when setting `svelte3/svelte3` as preprocessor #20

Closed YogliB closed 5 years ago

YogliB commented 5 years ago

This is my .eslintrc.js:

module.exports = {
  env: {
    browser: true,
    node: true,
    es6: true,
  },
  extends: ['eslint:recommended', 'prettier'],
  parserOptions: {
    ecmaVersion: 2019,
    sourceType: 'module',
  },
  plugins: ['svelte3'],
  overrides: [
    {
      files: '*.svelte',
      processor: 'svelte3/svelte3',
    },
  ],
  rules: {},
};

My package.json:

"devDependencies": {
    ...
    "eslint-plugin-svelte3": "1.2.3",
    "svelte": "3.5.4"
    ...
} 

The error I'm getting:

× eslint --fix found some errors. Please fix them and try committing again.

Error: ESLint configuration of processor in '.eslintrc.js#overrides[0]' is invalid: 'svelte3/svelte3' was not found.
  at validateProcessor (d:\Projects\OSS\material-components-svelte
ode_modules\eslint\lib\shared\config-validator.js:227:15)
  at validateConfigArray (d:\Projects\OSS\material-components-svelte
ode_modules\eslint\lib\shared\config-validator.js:336:9)
  at CascadingConfigArrayFactory._finalizeConfigArray (d:\Projects\OSS\material-components-svelte
ode_modules\eslint\lib\cli-engine\cascading-config-array-factory.js:380:13)
  at CascadingConfigArrayFactory.getConfigArrayForFile (d:\Projects\OSS\material-components-svelte
ode_modules\eslint\lib\cli-engine\cascading-config-array-factory.js:237:21)
  at FileEnumerator._iterateFilesWithFile (d:\Projects\OSS\material-components-svelte
ode_modules\eslint\lib\cli-engine\file-enumerator.js:329:43)
  at FileEnumerator._iterateFiles (d:\Projects\OSS\material-components-svelte
ode_modules\eslint\lib\cli-engine\file-enumerator.js:313:25)
  at FileEnumerator.iterateFiles (d:\Projects\OSS\material-components-svelte
ode_modules\eslint\lib\cli-engine\file-enumerator.js:254:59)
  at iterateFiles.next (<anonymous>)
  at CLIEngine.executeOnFiles (d:\Projects\OSS\material-components-svelte
ode_modules\eslint\lib\cli-engine\cli-engine.js:744:48)
  at Object.execute (d:\Projects\OSS\material-components-svelte
ode_modules\eslint\lib\cli.js:209:111)
Conduitry commented 5 years ago

You need to be using v2 of the plugin if you are using ESLint 6 and the processor: 'svelte3/svelte3' override.

YogliB commented 5 years ago

I've missed the update, thanks!