2021-11-18 08:32:43 -06:00
|
|
|
module.exports = {
|
|
|
|
root: true,
|
|
|
|
parser: '@typescript-eslint/parser',
|
|
|
|
plugins: [
|
|
|
|
'@typescript-eslint',
|
|
|
|
'import'
|
|
|
|
],
|
|
|
|
extends: [
|
|
|
|
'eslint:recommended',
|
|
|
|
'plugin:@typescript-eslint/recommended',
|
|
|
|
'plugin:import/recommended',
|
|
|
|
'plugin:import/typescript'
|
|
|
|
],
|
|
|
|
rules: {
|
|
|
|
'indent': ['warn', 'tab', {
|
|
|
|
'SwitchCase': 1,
|
2022-09-10 13:34:41 -05:00
|
|
|
'MemberExpression': 1,
|
2021-11-18 08:32:43 -06:00
|
|
|
'flatTernaryExpressions': true,
|
|
|
|
'ArrayExpression': 'first',
|
|
|
|
'ObjectExpression': 'first',
|
|
|
|
}],
|
|
|
|
'eol-last': ['error', 'always'],
|
|
|
|
'semi': ['error', 'always'],
|
2022-07-02 09:01:13 -05:00
|
|
|
'semi-spacing': ['error', { 'before': false, 'after': true }],
|
2021-11-18 08:32:43 -06:00
|
|
|
'quotes': ['warn', 'single'],
|
|
|
|
'comma-dangle': ['warn', 'always-multiline'],
|
2022-09-17 13:27:08 -05:00
|
|
|
'comma-spacing': ['error', { 'before': false, 'after': true }],
|
|
|
|
'array-bracket-spacing': ['error', 'never'],
|
2021-11-18 08:32:43 -06:00
|
|
|
'keyword-spacing': ['error', {
|
|
|
|
'before': true,
|
|
|
|
'after': true,
|
|
|
|
}],
|
|
|
|
'key-spacing': ['error', {
|
|
|
|
'beforeColon': false,
|
|
|
|
'afterColon': true,
|
|
|
|
}],
|
2022-06-22 23:19:17 -05:00
|
|
|
'arrow-spacing': ['error', {
|
|
|
|
'before': true,
|
|
|
|
'after': true,
|
|
|
|
}],
|
2023-10-08 22:36:25 -05:00
|
|
|
'brace-style': ['error', '1tbs', {
|
|
|
|
'allowSingleLine': true,
|
|
|
|
}],
|
2022-06-22 23:19:17 -05:00
|
|
|
'padded-blocks': ['error', 'never'],
|
2021-11-18 08:32:43 -06:00
|
|
|
/* TODO: path aliasを使わないとwarnする
|
|
|
|
'no-restricted-imports': ['warn', {
|
|
|
|
'patterns': [
|
|
|
|
]
|
|
|
|
}],
|
|
|
|
*/
|
2022-01-31 06:29:08 -06:00
|
|
|
'eqeqeq': ['error', 'always', { 'null': 'ignore' }],
|
2021-11-18 08:32:43 -06:00
|
|
|
'no-multi-spaces': ['error'],
|
|
|
|
'no-var': ['error'],
|
|
|
|
'prefer-arrow-callback': ['error'],
|
2023-05-28 21:54:49 -05:00
|
|
|
'no-throw-literal': ['error'],
|
2021-11-18 08:32:43 -06:00
|
|
|
'no-param-reassign': ['warn'],
|
|
|
|
'no-constant-condition': ['warn'],
|
|
|
|
'no-empty-pattern': ['warn'],
|
|
|
|
'no-async-promise-executor': ['off'],
|
|
|
|
'no-useless-escape': ['off'],
|
|
|
|
'no-multiple-empty-lines': ['error', { 'max': 1 }],
|
|
|
|
'no-control-regex': ['warn'],
|
|
|
|
'no-empty': ['warn'],
|
|
|
|
'no-inner-declarations': ['off'],
|
|
|
|
'no-sparse-arrays': ['off'],
|
|
|
|
'nonblock-statement-body-position': ['error', 'beside'],
|
|
|
|
'object-curly-spacing': ['error', 'always'],
|
|
|
|
'space-infix-ops': ['error'],
|
|
|
|
'space-before-blocks': ['error', 'always'],
|
2023-10-28 23:07:49 -05:00
|
|
|
'padding-line-between-statements': [
|
|
|
|
'error',
|
|
|
|
{ 'blankLine': 'always', 'prev': 'function', 'next': '*' },
|
|
|
|
{ 'blankLine': 'always', 'prev': '*', 'next': 'function' },
|
|
|
|
],
|
2023-10-30 05:38:27 -05:00
|
|
|
"lines-between-class-members": "off",
|
2023-10-31 06:14:36 -05:00
|
|
|
/* typescript-eslint では enforce に対応してないっぽい
|
2023-10-30 05:38:27 -05:00
|
|
|
'@typescript-eslint/lines-between-class-members': ['error', {
|
2023-10-30 03:31:49 -05:00
|
|
|
enforce: [{
|
|
|
|
blankLine: 'always',
|
|
|
|
prev: 'method',
|
|
|
|
next: '*',
|
|
|
|
}]
|
|
|
|
}],
|
2023-10-31 06:14:36 -05:00
|
|
|
*/
|
2023-09-18 19:44:05 -05:00
|
|
|
'@typescript-eslint/func-call-spacing': ['error', 'never'],
|
2023-07-31 05:14:20 -05:00
|
|
|
'@typescript-eslint/no-explicit-any': ['warn'],
|
|
|
|
'@typescript-eslint/no-unused-vars': ['warn'],
|
2022-01-31 06:34:47 -06:00
|
|
|
'@typescript-eslint/no-unnecessary-condition': ['warn'],
|
2021-11-18 08:32:43 -06:00
|
|
|
'@typescript-eslint/no-var-requires': ['warn'],
|
|
|
|
'@typescript-eslint/no-inferrable-types': ['warn'],
|
|
|
|
'@typescript-eslint/no-empty-function': ['off'],
|
|
|
|
'@typescript-eslint/no-non-null-assertion': ['warn'],
|
2023-09-17 23:26:43 -05:00
|
|
|
'@typescript-eslint/explicit-function-return-type': ['off'],
|
2021-11-18 08:32:43 -06:00
|
|
|
'@typescript-eslint/no-misused-promises': ['error', {
|
|
|
|
'checksVoidReturn': false,
|
|
|
|
}],
|
2022-09-20 15:33:11 -05:00
|
|
|
'@typescript-eslint/consistent-type-imports': 'off',
|
2022-09-17 13:27:08 -05:00
|
|
|
'@typescript-eslint/prefer-nullish-coalescing': [
|
2023-07-31 05:14:20 -05:00
|
|
|
'warn',
|
2022-09-17 13:27:08 -05:00
|
|
|
],
|
2023-02-21 23:51:34 -06:00
|
|
|
'@typescript-eslint/naming-convention': [
|
|
|
|
'error',
|
|
|
|
{
|
|
|
|
"selector": "typeLike",
|
|
|
|
"format": ["PascalCase"]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"selector": "typeParameter",
|
|
|
|
"format": []
|
|
|
|
}
|
|
|
|
],
|
2021-11-18 08:32:43 -06:00
|
|
|
'import/no-unresolved': ['off'],
|
|
|
|
'import/no-default-export': ['warn'],
|
2022-04-15 01:05:43 -05:00
|
|
|
'import/order': ['warn', {
|
|
|
|
'groups': ['builtin', 'external', 'internal', 'parent', 'sibling', 'index', 'object', 'type'],
|
|
|
|
}]
|
2021-11-18 08:32:43 -06:00
|
|
|
},
|
|
|
|
};
|