universo-platform-3d
135 строк · 6.5 Кб
1module.exports = {2parser: '@typescript-eslint/parser',3parserOptions: {4project: 'tsconfig.json',5sourceType: 'module'6},7plugins: ['@typescript-eslint/eslint-plugin'],8extends: [9'plugin:@typescript-eslint/recommended',10'plugin:prettier/recommended'11],12root: true,13env: {14node: true,15jest: true16},17ignorePatterns: ['.eslintrc.js'],18rules: {19'@typescript-eslint/interface-name-prefix': 'off',20'@typescript-eslint/explicit-function-return-type': 'off',21'@typescript-eslint/explicit-module-boundary-types': 'off',22'@typescript-eslint/no-explicit-any': 'off',23'@typescript-eslint/ban-ts-ignore': 'off',24'@typescript-eslint/ban-ts-comment': 'warn',25'@typescript-eslint/no-var-requires': 'warn',26semi: 'off',27'prettier/prettier': [28'error',29{30endOfLine: 'auto'31}32],33// Added 2023-08-27 22:13:3334'@typescript-eslint/await-thenable': 'error',35'@typescript-eslint/require-await': 'error',36'@typescript-eslint/restrict-template-expressions': 'error',37'require-await': 'error',38
39// TODO add these in. This is the partial from my PR that I time-boxed and ran into issues, so I didn't merge: https://github.com/the-mirror-megaverse/mirror-server/pull/485/files40// This is a paste of recommended-type-checked.ts as of Aug 25th '23: https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/recommended-type-checked.ts41// This is MODIFIED; I didn't use the above recommended so I could modify individual rules.42// '@typescript-eslint/await-thenable': 'error',43// '@typescript-eslint/ban-ts-comment': 'warn',44// '@typescript-eslint/ban-types': 'error',45// 'no-array-constructor': 'off',46// '@typescript-eslint/no-array-constructor': 'error',47// '@typescript-eslint/no-base-to-string': 'error',48// '@typescript-eslint/no-duplicate-enum-values': 'error',49// '@typescript-eslint/no-duplicate-type-constituents': 'error',50// '@typescript-eslint/no-explicit-any': 'off',51// '@typescript-eslint/no-extra-non-null-assertion': 'error',52// // TODO: this should be 'error', but I don't want to refactor everything in this PR.53// '@typescript-eslint/no-floating-promises': 'warn',54// '@typescript-eslint/no-for-in-array': 'error',55// 'no-implied-eval': 'off',56// '@typescript-eslint/no-implied-eval': 'error',57// 'no-loss-of-precision': 'off',58// '@typescript-eslint/no-loss-of-precision': 'error',59// '@typescript-eslint/no-misused-new': 'error',60// '@typescript-eslint/no-misused-promises': 'error',61// '@typescript-eslint/no-namespace': 'error',62// '@typescript-eslint/no-non-null-asserted-optional-chain': 'error',63// '@typescript-eslint/no-redundant-type-constituents': 'error',64// '@typescript-eslint/no-this-alias': 'error',65// '@typescript-eslint/no-unnecessary-type-assertion': 'error',66// '@typescript-eslint/no-unnecessary-type-constraint': 'error',67// '@typescript-eslint/no-unsafe-argument': 'warn',68// '@typescript-eslint/no-unsafe-assignment': 'warn',69// '@typescript-eslint/no-unsafe-call': 'warn',70// '@typescript-eslint/no-unsafe-declaration-merging': 'error',71// '@typescript-eslint/no-unsafe-enum-comparison': 'warn',72// '@typescript-eslint/no-unsafe-member-access': 'warn',73// '@typescript-eslint/no-unsafe-return': 'warn',74// 'no-unused-vars': 'off',75// '@typescript-eslint/no-unused-vars': 'warn',76// '@typescript-eslint/no-var-requires': 'warn',77// '@typescript-eslint/prefer-as-const': 'error',78// '@typescript-eslint/require-await': 'error',79// '@typescript-eslint/restrict-plus-operands': 'error',80// '@typescript-eslint/restrict-template-expressions': 'error',81// '@typescript-eslint/triple-slash-reference': 'error',82// '@typescript-eslint/unbound-method': 'error',83
84// // This is a paste of stylistic-type-checked.ts as of Aug 25th '23: https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/stylistic-type-checked.ts85// // This is MODIFIED; I didn't use the above recommended so I could modify individual rules.86// '@typescript-eslint/adjacent-overload-signatures': 'error',87// '@typescript-eslint/array-type': 'error',88// '@typescript-eslint/ban-tslint-comment': 'error',89// '@typescript-eslint/class-literal-property-style': 'error',90// '@typescript-eslint/consistent-generic-constructors': 'error',91// '@typescript-eslint/consistent-indexed-object-style': 'error',92// '@typescript-eslint/consistent-type-assertions': 'error',93// '@typescript-eslint/consistent-type-definitions': 'error',94// 'dot-notation': 'off',95// '@typescript-eslint/dot-notation': 'warn',96// '@typescript-eslint/no-confusing-non-null-assertion': 'error',97// 'no-empty-function': 'off',98// '@typescript-eslint/no-empty-function': 'error',99// '@typescript-eslint/no-empty-interface': 'error',100// '@typescript-eslint/no-inferrable-types': 'error',101// '@typescript-eslint/non-nullable-type-assertion-style': 'error',102// '@typescript-eslint/prefer-for-of': 'error',103// '@typescript-eslint/prefer-function-type': 'error',104// '@typescript-eslint/prefer-namespace-keyword': 'error',105// // commented out because we have strictNullChecks set to false106// // '@typescript-eslint/prefer-nullish-coalescing': 'warn',107// '@typescript-eslint/prefer-optional-chain': 'error',108// '@typescript-eslint/prefer-string-starts-ends-with': 'error',109},110overrides: [111{112files: ['test/**/*'],113rules: {114// These are here since we don't need to be as strict for tests, such as the usgae of `any`, which often comes in handy when writing tests quickly since defining types for tests can take a lot of time.115'@typescript-eslint/no-var-requires': 'warn',116'@typescript-eslint/require-await': 'warn',117'require-await': 'warn',118'@typescript-eslint/restrict-template-expressions': 'warn',119'@typescript-eslint/no-empty-function': 'warn',120
121'@typescript-eslint/no-unsafe-argument': 'off',122'@typescript-eslint/no-unsafe-assignment': 'off',123'@typescript-eslint/no-unsafe-call': 'off',124'@typescript-eslint/no-unsafe-declaration-merging': 'error',125'@typescript-eslint/no-unsafe-enum-comparison': 'warn',126'@typescript-eslint/no-unsafe-member-access': 'off',127'@typescript-eslint/no-unsafe-return': 'warn',128'@typescript-eslint/no-inferrable-types': 'warn',129'@typescript-eslint/ban-types': 'warn',130
131}132
133}134]135}
136