mirror of
https://github.com/toss/es-toolkit.git
synced 2024-11-24 03:32:58 +03:00
70 lines
2.2 KiB
JavaScript
70 lines
2.2 KiB
JavaScript
module.exports = {
|
|
root: true,
|
|
|
|
env: {
|
|
es6: true,
|
|
node: true,
|
|
browser: true,
|
|
jest: true,
|
|
'shared-node-browser': true,
|
|
},
|
|
|
|
parser: '@typescript-eslint/parser',
|
|
parserOptions: {
|
|
ecmaFeatures: { jsx: true },
|
|
},
|
|
|
|
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended', 'prettier', 'plugin:jsdoc/recommended'],
|
|
plugins: ['@typescript-eslint', 'jsdoc'],
|
|
rules: {
|
|
'no-implicit-coercion': 'error',
|
|
'no-warning-comments': [
|
|
'warn',
|
|
{
|
|
terms: ['TODO', 'FIXME', 'XXX', 'BUG'],
|
|
location: 'anywhere',
|
|
},
|
|
],
|
|
curly: ['error', 'all'],
|
|
eqeqeq: ['error', 'always', { null: 'ignore' }],
|
|
|
|
'@typescript-eslint/no-explicit-any': 'warn',
|
|
'@typescript-eslint/no-use-before-define': 'off',
|
|
'@typescript-eslint/no-empty-interface': 'off',
|
|
'@typescript-eslint/explicit-function-return-type': 'off',
|
|
'@typescript-eslint/no-parameter-properties': 'off',
|
|
'@typescript-eslint/no-var-requires': 'warn',
|
|
'@typescript-eslint/no-non-null-asserted-optional-chain': 'warn',
|
|
'@typescript-eslint/no-inferrable-types': 'warn',
|
|
'@typescript-eslint/no-empty-function': 'off',
|
|
'@typescript-eslint/naming-convention': [
|
|
'error',
|
|
{ format: ['camelCase', 'UPPER_CASE', 'PascalCase'], selector: 'variable', leadingUnderscore: 'allow' },
|
|
{ format: ['camelCase', 'PascalCase'], selector: 'function' },
|
|
{ format: ['PascalCase'], selector: 'interface' },
|
|
{ format: ['PascalCase'], selector: 'typeAlias' },
|
|
],
|
|
'@typescript-eslint/explicit-module-boundary-types': 'off',
|
|
'@typescript-eslint/array-type': ['error', { default: 'array-simple' }],
|
|
'@typescript-eslint/no-unused-vars': ['error', { ignoreRestSiblings: true }],
|
|
'@typescript-eslint/member-ordering': [
|
|
'error',
|
|
{
|
|
default: [
|
|
'public-static-field',
|
|
'private-static-field',
|
|
'public-instance-field',
|
|
'private-instance-field',
|
|
'public-constructor',
|
|
'private-constructor',
|
|
'public-instance-method',
|
|
'private-instance-method',
|
|
],
|
|
},
|
|
],
|
|
'jsdoc/tag-lines': 'off',
|
|
'jsdoc/no-defaults': 'off',
|
|
'jsdoc/require-jsdoc': 'off',
|
|
},
|
|
};
|