64 lines
1.7 KiB
JavaScript
64 lines
1.7 KiB
JavaScript
const js = require('@eslint/js');
|
|
const parser = require('@typescript-eslint/parser');
|
|
const plugin = require('@typescript-eslint/eslint-plugin');
|
|
const prettierPlugin = require('eslint-plugin-prettier');
|
|
const prettierConfig = require('eslint-config-prettier');
|
|
|
|
module.exports = [
|
|
js.configs.recommended,
|
|
prettierConfig,
|
|
{
|
|
files: ['**/*.ts'],
|
|
languageOptions: {
|
|
parser: parser,
|
|
parserOptions: {
|
|
project: './tsconfig.json',
|
|
sourceType: 'module',
|
|
},
|
|
globals: {
|
|
node: true,
|
|
jest: true,
|
|
describe: 'readonly',
|
|
it: 'readonly',
|
|
test: 'readonly',
|
|
expect: 'readonly',
|
|
beforeEach: 'readonly',
|
|
afterEach: 'readonly',
|
|
beforeAll: 'readonly',
|
|
afterAll: 'readonly',
|
|
},
|
|
},
|
|
plugins: {
|
|
'@typescript-eslint': plugin,
|
|
prettier: prettierPlugin,
|
|
},
|
|
rules: {
|
|
...plugin.configs.recommended.rules,
|
|
'@typescript-eslint/interface-name-prefix': 'off',
|
|
'@typescript-eslint/explicit-function-return-type': 'off',
|
|
'@typescript-eslint/explicit-module-boundary-types': 'off',
|
|
'@typescript-eslint/no-explicit-any': 'off',
|
|
'prettier/prettier': 'error',
|
|
},
|
|
},
|
|
{
|
|
files: ['**/*.spec.ts', '**/__tests__/**/*.ts', '**/test/**/*.ts'],
|
|
languageOptions: {
|
|
globals: {
|
|
describe: 'readonly',
|
|
it: 'readonly',
|
|
test: 'readonly',
|
|
expect: 'readonly',
|
|
beforeEach: 'readonly',
|
|
afterEach: 'readonly',
|
|
beforeAll: 'readonly',
|
|
afterAll: 'readonly',
|
|
jest: 'readonly',
|
|
},
|
|
},
|
|
},
|
|
{
|
|
ignores: ['dist/**', 'node_modules/**', 'coverage/**'],
|
|
},
|
|
];
|