.eslintrc.cjs
const OFF = 0;
const WARN = 1;
const ERROR = 2;
// /** @type {import('eslint/lib/shared/types').ConfigData & { parserOptions: import('@typescript-eslint/types').ParserOptions }} */
module.exports = {
root: true,
reportUnusedDisableDirectives: true,
parser: '@typescript-eslint/parser',
parserOptions: {
project: ['./test/tsconfig.json'],
tsconfigRootDir: __dirname,
},
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/eslint-recommended',
'airbnb-base',
'airbnb-typescript/base',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'plugin:unicorn/recommended',
'prettier',
'plugin:security/recommended',
],
plugins: ['prettier'],
rules: {
'@typescript-eslint/explicit-module-boundary-types': WARN,
'@typescript-eslint/no-use-before-define': WARN,
'import/extensions': WARN,
'import/prefer-default-export': OFF,
'no-restricted-syntax': OFF,
'no-underscore-dangle': OFF,
'no-void': OFF,
'prettier/prettier': WARN,
'unicorn/filename-case': OFF,
'unicorn/no-abusive-eslint-disable': WARN,
'unicorn/no-null': OFF,
'unicorn/prefer-add-event-listener': OFF,
'unicorn/prefer-dom-node-append': OFF,
'unicorn/prefer-module': OFF,
'unicorn/prefer-node-protocol': OFF,
'unicorn/prefer-query-selector': OFF,
'unicorn/prevent-abbreviations': OFF,
'unicorn/switch-case-braces': [ERROR, 'avoid'],
},
};