269 lines
9.4 KiB
JavaScript
269 lines
9.4 KiB
JavaScript
module.exports = {
|
|
root: true,
|
|
env: {
|
|
browser: true,
|
|
},
|
|
globals: {
|
|
NodeJS: true,
|
|
},
|
|
ignorePatterns: ['!**/*', 'jest.config.ts'],
|
|
overrides: [
|
|
{
|
|
files: ['*.ts'],
|
|
extends: ['plugin:@typescript-eslint/recommended'],
|
|
parser: '@typescript-eslint/parser',
|
|
parserOptions: {
|
|
project: './tsconfig.json',
|
|
tsconfigRootDir: __dirname,
|
|
},
|
|
rules: {
|
|
'@typescript-eslint/no-explicit-any': 'error',
|
|
'@typescript-eslint/explicit-member-accessibility': [
|
|
'error',
|
|
{
|
|
accessibility: 'no-public',
|
|
},
|
|
],
|
|
'@typescript-eslint/unbound-method': 'error',
|
|
'@typescript-eslint/no-floating-promises': 'off',
|
|
'@typescript-eslint/naming-convention': [
|
|
'error',
|
|
{
|
|
selector: 'memberLike',
|
|
modifiers: ['private'],
|
|
format: ['camelCase'],
|
|
leadingUnderscore: 'allow',
|
|
},
|
|
{
|
|
selector: 'memberLike',
|
|
modifiers: ['protected'],
|
|
format: ['camelCase'],
|
|
leadingUnderscore: 'allow',
|
|
},
|
|
{
|
|
selector: 'memberLike',
|
|
modifiers: ['private'],
|
|
format: ['UPPER_CASE', 'camelCase'],
|
|
leadingUnderscore: 'allow',
|
|
},
|
|
],
|
|
'@typescript-eslint/restrict-template-expressions': 'off',
|
|
'@typescript-eslint/lines-between-class-members': 'off',
|
|
'@typescript-eslint/member-ordering': [
|
|
'warn',
|
|
{
|
|
default: [
|
|
// Index signature
|
|
'signature',
|
|
'call-signature',
|
|
|
|
// Fields
|
|
'#private-static-field',
|
|
'private-static-field',
|
|
'protected-static-field',
|
|
'public-static-field',
|
|
|
|
'#private-instance-field',
|
|
'private-instance-field',
|
|
'protected-instance-field',
|
|
'public-instance-field',
|
|
|
|
'private-decorated-field',
|
|
'protected-decorated-field',
|
|
'public-decorated-field',
|
|
|
|
'protected-abstract-field',
|
|
'public-abstract-field',
|
|
|
|
'#private-field',
|
|
'private-field',
|
|
'protected-field',
|
|
'public-field',
|
|
|
|
'static-field',
|
|
'instance-field',
|
|
'abstract-field',
|
|
|
|
'decorated-field',
|
|
|
|
'field',
|
|
|
|
// Static initialization
|
|
'static-initialization',
|
|
|
|
// Constructors
|
|
'public-constructor',
|
|
'protected-constructor',
|
|
'private-constructor',
|
|
|
|
'constructor',
|
|
|
|
// Getters
|
|
'public-static-get',
|
|
'protected-static-get',
|
|
'private-static-get',
|
|
'#private-static-get',
|
|
|
|
'public-decorated-get',
|
|
'protected-decorated-get',
|
|
'private-decorated-get',
|
|
|
|
'public-instance-get',
|
|
'protected-instance-get',
|
|
'private-instance-get',
|
|
'#private-instance-get',
|
|
|
|
'public-abstract-get',
|
|
'protected-abstract-get',
|
|
|
|
'public-get',
|
|
'protected-get',
|
|
'private-get',
|
|
'#private-get',
|
|
|
|
'static-get',
|
|
'instance-get',
|
|
'abstract-get',
|
|
|
|
'decorated-get',
|
|
|
|
'get',
|
|
|
|
// Setters
|
|
'public-static-set',
|
|
'protected-static-set',
|
|
'private-static-set',
|
|
'#private-static-set',
|
|
|
|
'public-decorated-set',
|
|
'protected-decorated-set',
|
|
'private-decorated-set',
|
|
|
|
'public-instance-set',
|
|
'protected-instance-set',
|
|
'private-instance-set',
|
|
'#private-instance-set',
|
|
|
|
'public-abstract-set',
|
|
'protected-abstract-set',
|
|
|
|
'public-set',
|
|
'protected-set',
|
|
'private-set',
|
|
'#private-set',
|
|
|
|
'static-set',
|
|
'instance-set',
|
|
'abstract-set',
|
|
|
|
'decorated-set',
|
|
|
|
'set',
|
|
|
|
// Methods
|
|
'public-static-method',
|
|
'protected-static-method',
|
|
'private-static-method',
|
|
'#private-static-method',
|
|
|
|
'public-decorated-method',
|
|
'protected-decorated-method',
|
|
'private-decorated-method',
|
|
|
|
'public-instance-method',
|
|
'protected-instance-method',
|
|
'private-instance-method',
|
|
'#private-instance-method',
|
|
|
|
'public-abstract-method',
|
|
'protected-abstract-method',
|
|
|
|
'public-method',
|
|
'protected-method',
|
|
'private-method',
|
|
'#private-method',
|
|
|
|
'static-method',
|
|
'instance-method',
|
|
'abstract-method',
|
|
|
|
'decorated-method',
|
|
|
|
'method',
|
|
],
|
|
},
|
|
],
|
|
},
|
|
},
|
|
{
|
|
files: ['*.ts'],
|
|
extends: [
|
|
'eslint:recommended',
|
|
'plugin:@angular-eslint/recommended',
|
|
'plugin:@angular-eslint/template/process-inline-templates',
|
|
'plugin:prettier/recommended',
|
|
'plugin:rxjs/recommended',
|
|
],
|
|
rules: {
|
|
'rxjs/no-ignored-subscription': 'error',
|
|
'@angular-eslint/directive-selector': [
|
|
'error',
|
|
{
|
|
type: 'attribute',
|
|
prefix: 'iqser',
|
|
style: 'camelCase',
|
|
},
|
|
],
|
|
'@angular-eslint/component-selector': [
|
|
'error',
|
|
{
|
|
type: 'element',
|
|
prefix: 'iqser',
|
|
style: 'kebab-case',
|
|
},
|
|
],
|
|
'@angular-eslint/prefer-on-push-component-change-detection': 'error',
|
|
'@angular-eslint/use-lifecycle-interface': 'error',
|
|
'@angular-eslint/no-input-prefix': 'error',
|
|
'@angular-eslint/no-input-rename': 'error',
|
|
'@angular-eslint/no-output-on-prefix': 'error',
|
|
'@angular-eslint/no-output-rename': 'error',
|
|
'@angular-eslint/prefer-output-readonly': 'error',
|
|
'no-underscore-dangle': 'off',
|
|
'no-param-reassign': 'error',
|
|
'no-dupe-class-members': 'off',
|
|
'no-redeclare': 'off',
|
|
'no-unused-vars': 'off',
|
|
'consistent-return': 'off',
|
|
},
|
|
},
|
|
{
|
|
files: ['*.html'],
|
|
extends: ['plugin:@angular-eslint/template/recommended'],
|
|
},
|
|
{
|
|
files: ['*.html'],
|
|
excludedFiles: ['*inline-template-*.component.html'],
|
|
extends: ['plugin:prettier/recommended'],
|
|
rules: {
|
|
'prettier/prettier': [
|
|
'error',
|
|
{
|
|
parser: 'angular',
|
|
},
|
|
],
|
|
},
|
|
},
|
|
{
|
|
files: ['**/*.spec.ts'],
|
|
env: {
|
|
node: true,
|
|
jest: true,
|
|
},
|
|
rules: {
|
|
'@angular-eslint/prefer-on-push-component-change-detection': 'off',
|
|
},
|
|
},
|
|
],
|
|
};
|