strapi/.eslintrc.back.typescript.js

36 lines
1.3 KiB
JavaScript
Raw Normal View History

2022-11-09 11:02:35 +01:00
'use strict';
module.exports = {
parser: '@typescript-eslint/parser',
2022-11-28 13:31:15 +01:00
parserOptions: {
project: './tsconfig.eslint.json',
},
2022-11-09 11:02:35 +01:00
plugins: ['@typescript-eslint'],
2022-11-28 13:31:15 +01:00
extends: ['@strapi/eslint-config/typescript'],
2022-11-09 11:02:35 +01:00
globals: {
strapi: false,
},
2022-11-15 08:41:33 +01:00
// Instead of extending (which includes values that interfere with this configuration), only take the rules field
2022-11-17 21:19:33 +01:00
rules: {
...require('./.eslintrc.back.js').rules,
'import/no-extraneous-dependencies': ['error', { devDependencies: ['**/*.test.ts'] }],
2022-11-28 16:23:49 +01:00
// TODO: The following rules from @strapi/eslint-config/typescript are disabled because they're causing problems we need to solve or fix
2022-11-30 09:08:48 +01:00
// to be solved in configuration
2022-11-28 16:23:49 +01:00
'node/no-unsupported-features/es-syntax': 'off',
'import/prefer-default-export': 'off',
'node/no-missing-import': 'off',
'@typescript-eslint/brace-style': 'off', // TODO: fix conflict with prettier/prettier in data-transfer/engine/index.ts
2022-11-30 09:08:48 +01:00
// to be cleaned up throughout codebase (too many to fix at the moment)
'@typescript-eslint/no-use-before-define': 'warn',
2022-11-17 21:19:33 +01:00
},
2022-12-06 15:52:42 +01:00
// Disable only for tests
overrides: [
{
files: ['**.test.ts'],
rules: {
'@typescript-eslint/ban-ts-comment': 'warn', // as long as javascript is allowed in our codebase, we want to test erroneous typescript usage
},
},
],
2022-11-09 11:02:35 +01:00
};