2021-12-24 03:21:18 +09:00
|
|
|
module.exports = {
|
|
|
|
env: {
|
|
|
|
browser: true,
|
|
|
|
commonjs: true,
|
|
|
|
es6: false,
|
|
|
|
},
|
|
|
|
extends: ["eslint:recommended", "plugin:@typescript-eslint/recommended"],
|
|
|
|
parser: "@typescript-eslint/parser",
|
|
|
|
parserOptions: {
|
|
|
|
ecmaVersion: 8,
|
|
|
|
sourceType: "module",
|
|
|
|
ecmaFeatures: {
|
|
|
|
experimentalObjectRestSpread: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
plugins: ["@typescript-eslint"],
|
2022-01-06 09:35:19 +09:00
|
|
|
ignorePatterns: ['NetscriptDefinitions.d.ts', '*.js'],
|
2021-12-24 03:21:18 +09:00
|
|
|
rules: {
|
2022-08-16 23:18:41 +09:00
|
|
|
"@typescript-eslint/array-type": ["error", { "default": "array-simple" }],
|
|
|
|
"@typescript-eslint/ban-ts-comment": ["off"],
|
|
|
|
"@typescript-eslint/explicit-member-accessibility": ["off"],
|
|
|
|
"@typescript-eslint/explicit-module-boundary-types": ["off"],
|
|
|
|
"@typescript-eslint/no-non-null-assertion": ["off"],
|
|
|
|
"@typescript-eslint/no-use-before-define": ["off"],
|
2022-08-20 10:09:52 +09:00
|
|
|
|
|
|
|
"@typescript-eslint/explicit-function-return-type":["off"],
|
|
|
|
|
2022-08-16 23:18:41 +09:00
|
|
|
"@typescript-eslint/no-parameter-properties": ["off"],
|
|
|
|
"@typescript-eslint/no-unused-vars": [
|
|
|
|
"error",
|
|
|
|
{ "argsIgnorePattern": "^_", "varsIgnorePattern": "^_" }
|
|
|
|
],
|
|
|
|
"@typescript-eslint/ban-ts-ignore": ["off"],
|
|
|
|
"@typescript-eslint/no-empty-function": ["off"],
|
|
|
|
"no-return-await": "error",
|
|
|
|
"require-await": "error",
|
|
|
|
"no-async-promise-executor": "error",
|
|
|
|
"no-constant-condition": ["off"]
|
2021-12-24 03:21:18 +09:00
|
|
|
},
|
|
|
|
overrides: [
|
|
|
|
{
|
|
|
|
// enable the rule specifically for TypeScript files
|
|
|
|
files: ["*.ts", "*.tsx"],
|
|
|
|
rules: {
|
|
|
|
"@typescript-eslint/explicit-function-return-type": ["error"],
|
|
|
|
"@typescript-eslint/explicit-module-boundary-types": ["error"],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
// TypeScript configuration
|
|
|
|
files: ["**/*.ts", "**/*.tsx"],
|
|
|
|
parser: "@typescript-eslint/parser",
|
|
|
|
plugins: ["@typescript-eslint"],
|
|
|
|
extends: ["plugin:@typescript-eslint/recommended"],
|
|
|
|
rules: {
|
|
|
|
"lines-between-class-members": "off",
|
|
|
|
"no-empty-pattern": "off",
|
|
|
|
"no-useless-constructor": [
|
|
|
|
"off", // Valid for typescript due to property ctor shorthand
|
|
|
|
],
|
|
|
|
"@typescript-eslint/ban-ts-comment": "off",
|
|
|
|
"@typescript-eslint/ban-ts-ignore": "off",
|
|
|
|
"@typescript-eslint/camelcase": "off",
|
|
|
|
"@typescript-eslint/explicit-function-return-type": [
|
|
|
|
"error",
|
|
|
|
{
|
|
|
|
allowExpressions: true,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
"@typescript-eslint/member-delimiter-style": [
|
|
|
|
"error",
|
|
|
|
{
|
|
|
|
multiline: {
|
|
|
|
delimiter: "semi",
|
|
|
|
requireLast: true,
|
|
|
|
},
|
|
|
|
singleline: {
|
|
|
|
delimiter: "semi",
|
|
|
|
requireLast: false,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
"@typescript-eslint/member-ordering": [
|
|
|
|
"error",
|
|
|
|
{
|
|
|
|
default: [
|
|
|
|
"signature",
|
|
|
|
"static-field",
|
|
|
|
"instance-field",
|
|
|
|
"abstract-field",
|
|
|
|
"constructor",
|
|
|
|
"instance-method",
|
|
|
|
"abstract-method",
|
|
|
|
"static-method",
|
|
|
|
],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
"@typescript-eslint/no-explicit-any": "off",
|
|
|
|
"@typescript-eslint/no-use-before-define": "off",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
}
|