strapi/.eslintrc.js

41 lines
1.0 KiB
JavaScript
Raw Normal View History

const frontPaths = [
2021-04-29 11:11:46 +02:00
'packages/**/admin/src/**/*.js',
'packages/generators/app/lib/resources/files/admin/app.js',
2021-04-29 11:11:46 +02:00
'packages/**/ee/admin/**/*.js',
2021-04-29 13:51:12 +02:00
'packages/core/helper-plugin/**/*.js',
'packages/**/tests/front/**/*.js',
'test/config/front/**/*.js',
];
2022-10-24 18:06:23 +02:00
const backendRules = require('./.eslintrc.back.js');
2019-05-29 12:16:40 +02:00
module.exports = {
parserOptions: {
2022-08-24 12:56:28 +02:00
ecmaVersion: 2020,
2019-05-29 12:16:40 +02:00
},
overrides: [
{
// Backend javascript
files: ['packages/**/*.js', 'test/**/*.js', 'scripts/**/*.js'],
excludedFiles: frontPaths,
2022-10-24 18:06:23 +02:00
...backendRules,
},
// Backend typescript
{
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint'],
extends: ['plugin:@typescript-eslint/recommended'],
files: ['packages/**/*.ts', 'test/**/*.ts', 'scripts/**/*.ts'],
excludedFiles: frontPaths,
//...backendRules, // TODO: write a typescript-friendly version of this
},
// Frontend
{
files: frontPaths,
...require('./.eslintrc.front.js'),
},
],
2019-05-29 12:16:40 +02:00
};