-
Notifications
You must be signed in to change notification settings - Fork 63
Expand file tree
/
Copy patheslint.config.mjs
More file actions
112 lines (110 loc) · 3.54 KB
/
eslint.config.mjs
File metadata and controls
112 lines (110 loc) · 3.54 KB
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
import { FlatCompat } from '@eslint/eslintrc';
import tseslint from 'typescript-eslint';
// Create compat instance
const compat = new FlatCompat({
baseDirectory: './',
recommendedConfig: {},
allConfig: {},
overrideConfig: {},
warnIncompatible: true,
});
export default tseslint.config(
...compat.plugins(
'@typescript-eslint',
'react',
'react-dom',
'react-hooks',
'import',
'prettier',
'simple-import-sort',
),
{
languageOptions: {
ecmaVersion: 2020,
sourceType: 'module',
parser: tseslint.parser,
parserOptions: {
project: './tsconfig.json',
ecmaFeatures: {
jsx: true, // Allows for the parsing of JSX
},
},
globals: {
browser: true,
es6: true,
},
},
ignores: ['/src/analytics-node-client/src/client.min.js', '/eslint.config.msj'],
rules: {
'prettier/prettier': 'error',
'react/jsx-filename-extension': [2, { extensions: ['.js', '.jsx', '.ts', '.tsx'] }],
'react-dom/no-dangerously-set-innerhtml': 'error',
'react-hooks/exhaustive-deps': 'error',
'@typescript-eslint/await-thenable': 'error',
'@typescript-eslint/naming-convention': [
'error',
{
selector: 'class',
format: ['PascalCase'],
},
],
'import/no-extraneous-dependencies': ['error', { devDependencies: true }],
'no-restricted-imports': [
'error',
{
patterns: [
'@atlassianlabs/guipi-core-components/*',
'@atlassianlabs/guipi-jira-components/*',
'@atlassianlabs/jira-metaui-client/*',
'@atlassianlabs/jira-metaui-transformer/*',
'@atlassianlabs/jira-pi-client/*',
'@atlassianlabs/jira-pi-common-models/*',
'@atlassianlabs/pi-client-common/*',
],
},
],
'no-unused-vars': [
'error',
{
vars: 'all',
args: 'none',
caughtErrors: 'all',
ignoreRestSiblings: false,
},
],
'brace-style': 'off',
'no-throw-literal': 'error',
'no-var': 'error',
'prefer-const': 'error',
'no-cond-assign': 'error',
'no-multi-assign': 'error',
'no-unused-expressions': [
'error',
{
allowShortCircuit: true,
allowTernary: true,
},
],
curly: 'error',
eqeqeq: ['error', 'always'],
semi: 'off',
'simple-import-sort/imports': 'error',
},
settings: {
react: {
version: 'detect', // Tells eslint-plugin-react to automatically detect the version of React to use
},
'import/parsers': {
'@typescript-eslint/parser': ['.ts', '.tsx'],
},
'import/resolver': {
typescript: {},
},
},
},
// Add missing dependencies
{
name: 'atlascode-ts-config',
files: ['**/*.ts', '**/*.tsx'],
},
);