forked from segmentio/typewriter
-
Notifications
You must be signed in to change notification settings - Fork 3
/
eslint.config.js
57 lines (54 loc) · 1.5 KB
/
eslint.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
import { FlatCompat } from '@eslint/eslintrc';
import tsParser from '@typescript-eslint/parser';
import tsPlugin from '@typescript-eslint/eslint-plugin';
import prettierPlugin from 'eslint-plugin-prettier';
import reactPlugin from 'eslint-plugin-react';
const compat = new FlatCompat({
baseDirectory: process.cwd(), // or __dirname if your config file is in the root
resolvePluginsRelativeTo: import.meta.url,
});
export default [
{
ignores: [
'tests/e2e/**/analytics/*',
'src/analytics/**/*',
'example/analytics/**/*',
'examples/js-cdn-typescript/**/*',
'examples/js-npm-typescript/**/*',
],
},
...compat.extends('plugin:@typescript-eslint/recommended'),
...compat.extends('plugin:prettier/recommended'),
...compat.extends('plugin:react/recommended'),
{
files: ['**/*.ts', '**/*.tsx'],
languageOptions: {
parser: tsParser,
ecmaVersion: 2018,
sourceType: 'module',
},
plugins: {
'@typescript-eslint': tsPlugin,
prettier: prettierPlugin,
react: reactPlugin,
},
settings: {
react: {
version: '16.8.6',
},
},
rules: {
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-namespace': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/interface-name-prefix': 'off',
'@typescript-eslint/no-explicit-any': 'off',
},
},
{
files: ['**/*.tsx'],
rules: {
'react/prop-types': 'off',
},
},
];