2019-01-18 01:10:03 +03:00
|
|
|
module.exports = {
|
2022-02-03 19:48:31 +03:00
|
|
|
extends: ['plugin:@typescript-eslint/recommended', 'plugin:prettier/recommended', 'plugin:security/recommended'],
|
2021-02-03 21:30:46 +03:00
|
|
|
parser: '@typescript-eslint/parser',
|
2022-02-03 19:48:31 +03:00
|
|
|
plugins: ['import', 'notice', '@typescript-eslint', 'security'],
|
2019-01-18 01:10:03 +03:00
|
|
|
env: {
|
|
|
|
browser: true,
|
|
|
|
es6: true,
|
|
|
|
node: true,
|
|
|
|
},
|
|
|
|
rules: {
|
|
|
|
// eslint rules
|
|
|
|
'no-dupe-class-members': 'off',
|
|
|
|
'no-undef': 'off', // ts compiler catches this
|
|
|
|
'prefer-const': 'error',
|
2020-01-29 00:10:47 +03:00
|
|
|
'padding-line-between-statements': [
|
|
|
|
1,
|
|
|
|
{ blankLine: 'always', prev: '*', next: 'case' },
|
|
|
|
{ blankLine: 'always', prev: '*', next: 'case' },
|
|
|
|
],
|
2019-01-18 01:10:03 +03:00
|
|
|
// plugin: import
|
|
|
|
'import/first': 'error',
|
|
|
|
'import/order': ['error', { 'newlines-between': 'always' }],
|
|
|
|
|
|
|
|
// plugin: notice
|
|
|
|
'notice/notice': [
|
|
|
|
'error',
|
|
|
|
{
|
|
|
|
mustMatch: 'Copyright \\(c\\) Microsoft',
|
|
|
|
templateFile: require.resolve('./copyright.js'),
|
|
|
|
messages: {
|
|
|
|
whenFailedToMatch: 'Missing copyright header.',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
|
|
|
|
// plugin: typescript
|
2021-02-03 21:30:46 +03:00
|
|
|
'@typescript-eslint/explicit-function-return-type': 'off',
|
|
|
|
'@typescript-eslint/explicit-member-accessibility': 'off',
|
|
|
|
'@typescript-eslint/indent': 'off',
|
|
|
|
'@typescript-eslint/no-empty-interface': 'warn',
|
|
|
|
'@typescript-eslint/no-object-literal-type-assertion': 'off',
|
|
|
|
'@typescript-eslint/no-parameter-properties': 'off',
|
|
|
|
'@typescript-eslint/no-use-before-define': ['error', { functions: false, classes: false }],
|
2019-01-18 01:10:03 +03:00
|
|
|
},
|
|
|
|
overrides: [
|
|
|
|
{
|
|
|
|
files: ['**/*.+(js|jsx)'],
|
|
|
|
parser: 'babel-eslint',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
files: ['**/*.+(test|spec).+(js|jsx|ts|tsx)'],
|
|
|
|
env: {
|
|
|
|
jest: true,
|
|
|
|
},
|
|
|
|
rules: {
|
|
|
|
'typescript/class-name-casing': 'off',
|
2019-02-02 02:54:38 +03:00
|
|
|
'typescript/no-explicit-any': 'off',
|
2021-02-03 21:30:46 +03:00
|
|
|
'@typescript-eslint/ban-ts-comment': 'off',
|
2019-01-18 01:10:03 +03:00
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
};
|