dashboard/.eslintrc.js

59 lines
1.9 KiB
JavaScript
Raw Normal View History

const rules = require('./tools/eslint-config/rules');
2021-08-02 15:06:09 +00:00
const baseTsRules = {
parserOptions: {
2021-08-02 16:31:36 +00:00
project: ['tsconfig.json'],
2021-08-02 15:06:09 +00:00
createDefaultProgram: true,
},
extends: [
'./tools/eslint-config/typescript',
'./tools/eslint-config/angular',
'./tools/eslint-config/lodash',
'prettier',
2021-08-02 15:06:09 +00:00
],
rules: {
...rules.createImportOrderRule({ internalPathsPattern: '@dsh/**' }),
// TODO: pretenders for error
'@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/unbound-method': 'warn',
'@typescript-eslint/restrict-plus-operands': 'warn',
'@typescript-eslint/restrict-template-expressions': 'warn',
'@typescript-eslint/no-unsafe-argument': 'warn',
2021-08-02 15:06:09 +00:00
},
};
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
ignorePatterns: ['**/openapi-codegen/**/*.ts', '**/swagger-codegen/**/*.ts'],
overrides: [
{
2021-08-02 15:06:09 +00:00
...baseTsRules,
files: ['*.ts'],
rules: {
2021-08-02 15:06:09 +00:00
...baseTsRules.rules,
...rules.createAngularSelectorRules({ prefix: 'dsh' }),
// TODO: pretenders for error
'@typescript-eslint/no-floating-promises': 'warn',
},
},
{
2021-08-02 15:06:09 +00:00
...baseTsRules,
files: ['*.spec.ts'],
extends: [...baseTsRules.extends, './tools/eslint-config/jasmine'],
},
{
files: ['*.html'],
extends: ['plugin:@angular-eslint/template/recommended'],
rules: {
// TODO: pretenders for error
'@angular-eslint/template/no-negated-async': 'warn',
},
},
],
};