-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy patheslint.config.js
More file actions
76 lines (75 loc) · 2.17 KB
/
Copy patheslint.config.js
File metadata and controls
76 lines (75 loc) · 2.17 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
const js = require('@eslint/js')
const typescriptEslint = require('@typescript-eslint/eslint-plugin')
const tsParser = require('@typescript-eslint/parser')
const globals = require('globals')
const simpleImportSort = require('eslint-plugin-simple-import-sort')
const prettierRecommended = require('eslint-plugin-prettier/recommended')
module.exports = [
{
ignores: [
'**/node_modules/**',
'lib/**',
'sample/**',
// Codegen spec files have strict type requirements (Object vs object, semicolons)
// dictated by React Native's codegen — do not lint or auto-fix these.
'src/fabric/**',
],
},
js.configs.recommended,
prettierRecommended,
// Prettier formatting is advisory — existing files with different style won't block CI.
{ rules: { 'prettier/prettier': 'warn' } },
// CommonJS config/script files
{
files: ['**/*.js', '**/*.jsx'],
languageOptions: {
globals: {
...globals.commonjs,
...globals.node,
},
},
},
// TypeScript source files
{
files: ['**/*.ts', '**/*.tsx'],
languageOptions: {
parser: tsParser,
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
},
},
plugins: {
'@typescript-eslint': typescriptEslint,
'simple-import-sort': simpleImportSort,
},
rules: {
...typescriptEslint.configs.recommended.rules,
// Wrapper types (String/Number/Boolean/Object) exist in pre-existing model files;
// downgrade so existing code doesn't block CI.
'@typescript-eslint/no-wrapper-object-types': 'warn',
'import/order': 'off',
// Warn rather than error so pre-existing unsorted imports don't block CI.
'simple-import-sort/exports': 'warn',
'simple-import-sort/imports': 'warn',
'sort-imports': 'off',
},
},
// Test files — add jest globals and relax any-type rules used in mocks
{
files: [
'**/__tests__/**/*.ts',
'**/__tests__/**/*.tsx',
'**/*.test.ts',
'**/*.test.tsx',
],
languageOptions: {
globals: {
...globals.jest,
},
},
rules: {
'@typescript-eslint/no-explicit-any': 'off',
},
},
]