control-center/.eslintrc.js

64 lines
1.8 KiB
JavaScript
Raw Normal View History

2022-01-11 17:07:27 +00:00
const rules = require('./tools/eslint-config/rules');
const baseTsRules = {
2022-01-11 17:07:27 +00:00
parserOptions: {
project: ['tsconfig.json'],
createDefaultProgram: true,
},
extends: [
'./tools/eslint-config/typescript',
'./tools/eslint-config/angular',
'./tools/eslint-config/lodash',
'prettier',
],
rules: {
...rules.createImportOrderRule({ internalPathsPattern: '@cc/**' }),
2022-05-24 12:01:51 +00:00
'@typescript-eslint/unbound-method': ['error', { ignoreStatic: true }],
...rules.createAngularSelectorRules({ prefix: 'cc' }),
2022-01-11 17:07:27 +00:00
},
};
2022-05-24 12:01:51 +00:00
// TODO: pretenders for error
const lenientTsRules = {
'@typescript-eslint/no-unsafe-call': 'warn',
'@typescript-eslint/no-unsafe-member-access': 'warn',
'@typescript-eslint/no-unsafe-assignment': 'warn',
'@typescript-eslint/no-unsafe-return': 'warn',
'@typescript-eslint/no-misused-promises': 'warn',
'@typescript-eslint/no-unsafe-argument': 'warn',
};
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
overrides: [
{
2022-01-11 17:07:27 +00:00
...baseTsRules,
files: ['*.ts'],
rules: {
2022-01-11 17:07:27 +00:00
...baseTsRules.rules,
2022-05-24 12:01:51 +00:00
...lenientTsRules,
},
},
2022-05-24 12:01:51 +00:00
{
...baseTsRules,
// TODO: add fixed directories
files: ['**/src/app/core/**/*.ts'],
},
{
2022-01-11 17:07:27 +00:00
...baseTsRules,
files: ['*.spec.ts'],
2022-01-11 17:07:27 +00:00
extends: [...baseTsRules.extends, './tools/eslint-config/jasmine'],
2022-05-24 12:01:51 +00:00
rules: lenientTsRules,
},
{
files: ['*.html'],
extends: ['plugin:@angular-eslint/template/recommended'],
rules: {
// TODO: pretenders for error
'@angular-eslint/template/no-negated-async': 'warn',
},
},
],
};