mirror of
https://github.com/strapi/strapi.git
synced 2025-09-25 16:29:34 +00:00
add linting
This commit is contained in:
parent
b7a87dcffc
commit
e82b720585
@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
parser: '@typescript-eslint/parser',
|
parser: '@typescript-eslint/parser',
|
||||||
|
parserOptions: {
|
||||||
|
project: './tsconfig.eslint.json',
|
||||||
|
},
|
||||||
plugins: ['@typescript-eslint'],
|
plugins: ['@typescript-eslint'],
|
||||||
/**
|
extends: ['@strapi/eslint-config/typescript'],
|
||||||
* TODO: this should extend @strapi/eslint-config/typescript but doing so requires configuring parserOption.project, which requires tsconfig.json configuration
|
|
||||||
*/
|
|
||||||
// extends: ['plugin:@typescript-eslint/recommended'],
|
|
||||||
globals: {
|
globals: {
|
||||||
strapi: false,
|
strapi: false,
|
||||||
},
|
},
|
||||||
@ -14,5 +14,10 @@ module.exports = {
|
|||||||
rules: {
|
rules: {
|
||||||
...require('./.eslintrc.back.js').rules,
|
...require('./.eslintrc.back.js').rules,
|
||||||
'import/no-extraneous-dependencies': ['error', { devDependencies: ['**/*.test.ts'] }],
|
'import/no-extraneous-dependencies': ['error', { devDependencies: ['**/*.test.ts'] }],
|
||||||
|
// TODO: The following rules from @strapi/eslint-config/typescript are disabled because they require praserOptions.project configuration
|
||||||
|
// '@typescript-eslint/dot-notation': 'off',
|
||||||
|
// '@typescript-eslint/no-implied-eval': 'off',
|
||||||
|
// '@typescript-eslint/no-throw-literal': 'off',
|
||||||
|
// '@typescript-eslint/return-await': 'off',
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
8
tsconfig.eslint.json
Normal file
8
tsconfig.eslint.json
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"composite": true,
|
||||||
|
"declaration": true,
|
||||||
|
"declarationMap": true,
|
||||||
|
"incremental": true
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user