eslint-plugin-svelte

What

Just an alias to eslint-plugin-svelte3

Why

Personally I'd prefer a consistent eslint plugin for all versions of a framework like eslint-plugin-vue, but the original author of this plugin has different opinion. So I decide to just post this alias package for constant and cleaner usage for myself.

How

Version strategy

We will start from v1.1.1 which represents v3.1.1 of eslint-plugin-svelte3 , and follow all of its versions then. What means maybe following (notice: the version of eslint-plugin-svelte* are all just assumptions):

  1. patch: [email protected] -> [email protected]
  2. minor: [email protected] -> [email protected]
  3. major:
    1. [email protected] -> [email protected]
    2. [email protected] -> [email protected]
    3. [email protected] -> [email protected]

If we are changing some internal codes, the version would be x.y.z-minor.patch.

Usage

It should be just like eslint-plugin-svelte3 itself, but renaming all svelte* to simple svelte, for instance:

module.exports = {
  parserOptions: {
    ecmaVersion: 2019,
    sourceType: 'module',
  },
  env: {
    es6: true,
    browser: true,
  },
  plugins: ['svelte'],
  overrides: [
    {
      files: ['*.svelte'],
      processor: 'svelte/svelte',
    },
  ],
  rules: {
    // ...
  },
  settings: {
    'svelte/typescript': require('typescript'), // pass the TypeScript package to the Svelte plugin
    // ...
  },
}

Don't forget to read original documentation first.

License

MIT © JounQin@1stG.me

Top categories

svelte logo

Want a Svelte site built?

Hire a Svelte developer
Loading Svelte Themes