-
Hello Eslint community, In my project, I've split the eslint config into to sections by applying different rules/configs to /** @type {import('eslint').Linter.Config} */
const typescriptConfig = {
env: {
node: true,
es2020: true,
jest: true,
},
parser: '@typescript-eslint/parser',
parserOptions: {
project: './tsconfig.json',
ecmaVersion: 2020,
},
plugins: ['sonarjs', 'jest', 'simple-import-sort', 'prettier'],
extends: [
'airbnb-typescript/base',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'plugin:jest/recommended',
'plugin:node/recommended-script',
'plugin:sonarjs/recommended',
'prettier',
],
rules: {
'prettier/prettier': 'error',
'simple-import-sort/imports': 'error',
'simple-import-sort/exports': 'error',
'node/no-unsupported-features/es-syntax': [
'error',
{ ignores: ['modules'] },
],
'no-console': 'off',
},
settings: {
node: {
tryExtensions: ['.ts'],
},
},
};
/** @type {import('eslint').Linter.Config} */
const javascriptConfig = {
env: {
commonjs: true,
es6: true,
node: true,
},
extends: ['airbnb-base'],
parserOptions: {
ecmaVersion: 2020,
},
};
/** @type {import('eslint').Linter.Config} */
module.exports = {
root: true,
overrides: [
{
files: '*.ts',
...typescriptConfig,
},
{
files: '*.js',
...javascriptConfig,
},
],
}; As you can see, I've reserved most of the plugins/rules to typescript files. But for some reason, the You can see this when I run ...
}
},
"plugins": [
"import"
],
"rules": {
"strict": [
... So, ehm, why is this? Can I not specify plugins/extensions based on glob pattern? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Check that the rules aren’t being enabled in one of the configs you have in “extends” |
Beta Was this translation helpful? Give feedback.
Check that the rules aren’t being enabled in one of the configs you have in “extends”