1.3.6 • Published 3 years ago

eslint-config-vospel v1.3.6

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

Marek Vospěl's eslint configs

eslint-config-vospel is deprecated. Switch to @vospel/eslint-config!

Github license npm

These are settings for Eslint I use in my projects.

Installing

Install eslint and eslint-config-vospel

npm i -D eslint eslint-config-vospel

Add extends to your .eslintrc

module.exports = {
  extends: [
    'vospel',
  ],
}

Typescript config

Install @typescript-eslint dependencies.

npm i -D eslint eslint-config-vospel @typescript-eslint/eslint-plugin @typescript-eslint/parser

Add following extends to your .eslintrc. Extending vospel (vospel/base) is unnecessary, because the typescript config extends it.

module.exports = {
  extends: [
    'vospel/typescript',
  ],
}

Vue config

Install optional vue-eslint dependencies

npm i -D eslint eslint-config-vospel eslint-plugin-vue

Add vospel/vue to your .eslintrc.

module.exports = {
  extends: [
    'vospel/vue',
  ],
}

You should also extend vospel (vospel/base) or vospel/typescript (which extends vospel/base), as this configuration only has rules, that apply for vue. The vue (vue3) configuration is using vue/block-lang to enforce usage of typescript. If your project doesn't use typescript, overwrite it with your own vue/block-lang options, or disable it

module.exports = {
  extends: [
    'vospel',
    'vospel/vue',
  ],
  rules: {
    // Simply disable vue/block-lang, if you don't want to use this rule
    'vue/block-lang': ['off'],
    // Change options of vue/block-lang, so it doesn't require typescript
    'vue/block-lang': ['error', {
      script: {
        allowNoLang: true,
        lang: ['js', 'ts'],
      },
    }],
  }
}

If you wish to use vospel/vue with vospel/typescript you'll have to add @typescript-eslint/parser as parser option to parserOptions.

module.exports = {
  extends: [
    'vospel/typescript',
    'vospel/vue',
  ],
  parserOptions: {
    parser: '@typescript-eslint/parser'
  }
}

Don't forget to install @typescript-eslint dependencies (see Typescript config)

1.3.6

3 years ago

1.3.5

3 years ago

1.2.0

3 years ago

1.1.0

3 years ago

1.3.4

3 years ago

1.3.3

3 years ago

1.3.2

3 years ago

1.3.1

3 years ago

1.2.2

3 years ago

1.3.0

3 years ago

1.2.1

3 years ago

1.0.0

3 years ago