123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247 |
- /* eslint-disable id-blacklist */
- module.exports = {
- ignorePatterns: [
- '*.js', '/bin'
- ],
- env: {
- browser: true,
- es6: true,
- node: true,
- },
- extends: [
- 'plugin:@typescript-eslint/recommended-requiring-type-checking',
- ],
- parser: '@typescript-eslint/parser',
- parserOptions: {
- project: 'tsconfig.json',
- sourceType: 'module',
- },
- plugins: [
- 'eslint-plugin-import',
- 'eslint-plugin-prefer-arrow',
- '@typescript-eslint',
- ],
- rules: {
- '@typescript-eslint/adjacent-overload-signatures': 'error',
- '@typescript-eslint/array-type': [
- 'error',
- {
- default: 'array',
- },
- ],
- '@typescript-eslint/ban-types': [
- 'error',
- {
- types: {
- Object: {
- message: 'Avoid using the `Object` type. Did you mean `object`?',
- },
- Function: {
- message: 'Avoid using the `Function` type. Prefer a specific function type, like `() => void`.',
- },
- Boolean: {
- message: 'Avoid using the `Boolean` type. Did you mean `boolean`?',
- },
- Number: {
- message: 'Avoid using the `Number` type. Did you mean `number`?',
- },
- String: {
- message: 'Avoid using the `String` type. Did you mean `string`?',
- },
- Symbol: {
- message: 'Avoid using the `Symbol` type. Did you mean `symbol`?',
- },
- },
- },
- ],
- '@typescript-eslint/consistent-type-assertions': 'error',
- '@typescript-eslint/dot-notation': 'error',
- '@typescript-eslint/indent': [
- 'error',
- 2,
- ],
- '@typescript-eslint/member-delimiter-style': [
- 'error',
- {
- multiline: {
- delimiter: 'comma',
- requireLast: true,
- },
- singleline: {
- delimiter: 'comma',
- requireLast: false,
- },
- overrides: {
- interface: {
- multiline: {
- delimiter: 'semi',
- requireLast: true,
- },
- },
- },
- },
- ],
- '@typescript-eslint/member-ordering': 'off',
- '@typescript-eslint/restrict-template-expressions': 'off',
- '@typescript-eslint/no-empty-function': 'error',
- '@typescript-eslint/no-empty-interface': 'error',
- '@typescript-eslint/no-explicit-any': 'off',
- '@typescript-eslint/no-floating-promises': 'off',
- '@typescript-eslint/no-misused-new': 'error',
- '@typescript-eslint/no-namespace': 'error',
- '@typescript-eslint/no-parameter-properties': 'off',
- '@typescript-eslint/no-require-imports': 'error',
- '@typescript-eslint/no-shadow': [
- 'error',
- {
- hoist: 'all',
- },
- ],
- '@typescript-eslint/no-unused-expressions': 'error',
- '@typescript-eslint/no-use-before-define': 'off',
- '@typescript-eslint/no-var-requires': 'off',
- '@typescript-eslint/prefer-for-of': 'error',
- '@typescript-eslint/prefer-function-type': 'error',
- '@typescript-eslint/prefer-namespace-keyword': 'error',
- '@typescript-eslint/quotes': [
- 'error',
- 'single',
- {
- avoidEscape: true,
- },
- ],
- '@typescript-eslint/semi': [
- 'error',
- 'always',
- ],
- '@typescript-eslint/triple-slash-reference': [
- 'error',
- {
- path: 'always',
- types: 'prefer-import',
- lib: 'always',
- },
- ],
- '@typescript-eslint/type-annotation-spacing': 'off',
- '@typescript-eslint/unified-signatures': 'error',
- 'arrow-body-style': [
- 'error',
- 'as-needed',
- ],
- 'arrow-parens': [
- 'off',
- 'always',
- ],
- 'brace-style': [
- 'error',
- '1tbs',
- {
- allowSingleLine: true,
- },
- ],
- 'capitalized-comments': [
- 'error',
- 'never',
- ],
- 'comma-dangle': [
- 'error',
- {
- objects: 'always-multiline',
- arrays: 'always-multiline',
- functions: 'never',
- imports: 'never',
- exports: 'never',
- },
- ],
- complexity: 'off',
- 'constructor-super': 'error',
- curly: [
- 'error',
- 'multi-line',
- ],
- 'eol-last': 'error',
- eqeqeq: [
- 'error',
- 'smart',
- ],
- 'guard-for-in': 'error',
- 'id-blacklist': [
- 'error',
- 'any',
- 'Number',
- 'number',
- 'String',
- 'string',
- 'Boolean',
- 'boolean',
- 'Undefined',
- 'undefined',
- ],
- 'id-match': 'error',
- 'import/order': 'error',
- 'linebreak-style': [
- 'error',
- 'unix',
- ],
- 'max-classes-per-file': 'off',
- 'max-len': 'off',
- 'new-parens': 'off',
- 'newline-per-chained-call': 'off',
- 'no-bitwise': 'off',
- 'no-caller': 'error',
- 'no-cond-assign': 'error',
- 'no-console': 'off',
- 'no-debugger': 'error',
- 'no-empty': 'error',
- 'no-eval': 'error',
- 'no-extra-semi': 'off',
- 'no-fallthrough': 'off',
- 'no-invalid-this': 'off',
- 'no-irregular-whitespace': 'error',
- 'no-multiple-empty-lines': 'error',
- 'no-new-wrappers': 'error',
- 'no-throw-literal': 'error',
- 'no-trailing-spaces': 'off',
- 'no-undef-init': 'error',
- 'no-underscore-dangle': 'off',
- 'no-unsafe-finally': 'error',
- 'no-unused-labels': 'error',
- 'no-var': 'error',
- 'object-shorthand': 'error',
- 'one-var': [
- 'error',
- 'never',
- ],
- 'prefer-arrow/prefer-arrow-functions': 'error',
- 'prefer-const': 'error',
- 'quote-props': [
- 'error',
- 'as-needed',
- ],
- radix: 'error',
- 'react/jsx-curly-spacing': 'off',
- 'react/jsx-equals-spacing': 'off',
- 'react/jsx-tag-spacing': [
- 'off',
- {
- afterOpening: 'allow',
- closingSlash: 'allow',
- },
- ],
- 'react/jsx-wrap-multilines': 'off',
- 'space-before-function-paren': [
- 'error',
- {
- anonymous: 'always',
- named: 'never',
- asyncArrow: 'always',
- },
- ],
- 'space-in-parens': [
- 'error',
- 'never',
- ],
- 'use-isnan': 'error',
- 'valid-typeof': 'off',
- },
- };
|