Skip to content

Commit 501b134

Browse files
authored
Merge pull request #103 from planetlabs/eslint-v9
Update to eslint v9 flat config
2 parents d33609d + 77c28c0 commit 501b134

File tree

6 files changed

+498
-501
lines changed

6 files changed

+498
-501
lines changed

eslint.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import planetConfig from './react.js';
2+
3+
export default [...planetConfig];

index.js

Lines changed: 131 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -1,84 +1,133 @@
1-
module.exports = {
2-
plugins: ['import', 'sort-imports-es6-autofix', 'prettier'],
3-
env: {
4-
node: true,
5-
browser: true,
6-
es6: true,
7-
},
8-
parserOptions: {
9-
ecmaVersion: 'latest',
10-
sourceType: 'module',
11-
},
12-
rules: {
13-
'array-callback-return': 'error',
14-
'block-scoped-var': 'error',
15-
curly: 'error',
16-
'default-case': 'error',
17-
'dot-notation': ['error', {allowPattern: '^[a-z]+(_[a-z]+)+$'}],
18-
eqeqeq: 'error',
19-
'import/default': 'error',
20-
'import/extensions': ['error', 'always', {ignorePackages: true}],
21-
'import/first': 'error',
22-
'import/named': 'error',
23-
'import/no-duplicates': 'error',
24-
'import/no-self-import': 'error',
25-
'import/no-unresolved': ['error', {commonjs: true}],
26-
'no-case-declarations': 'error',
27-
'no-cond-assign': 'error',
28-
'no-console': 'error',
29-
'no-const-assign': 'error',
30-
'no-constant-binary-expression': 'error',
31-
'no-control-regex': 'error',
32-
'no-debugger': 'error',
33-
'no-delete-var': 'error',
34-
'no-dupe-args': 'error',
35-
'no-dupe-keys': 'error',
36-
'no-duplicate-case': 'error',
37-
'no-empty': 'error',
38-
'no-empty-character-class': 'error',
39-
'no-eq-null': 'error',
40-
'no-ex-assign': 'error',
41-
'no-extra-boolean-cast': 'error',
42-
'no-fallthrough': 'error',
43-
'no-func-assign': 'error',
44-
'no-inner-declarations': ['error', 'functions'],
45-
'no-invalid-regexp': 'error',
46-
'no-irregular-whitespace': 'error',
47-
'no-negated-in-lhs': 'error',
48-
'no-obj-calls': 'error',
49-
'no-octal': 'error',
50-
'no-param-reassign': 'error',
51-
'no-process-exit': 'off',
52-
'no-redeclare': 'error',
53-
'no-regex-spaces': 'error',
54-
'no-sparse-arrays': 'error',
55-
'no-undef': 'error',
56-
'no-underscore-dangle': 'off',
57-
'no-unexpected-multiline': 'error',
58-
'no-unreachable': 'error',
59-
'no-unsafe-finally': 'error',
60-
'no-unused-vars': ['error', {ignoreRestSiblings: true}],
61-
'no-use-before-define': ['error', 'nofunc'],
62-
'no-var': 'error',
63-
'prefer-const': 'error',
64-
'prettier/prettier': [
65-
'error',
66-
{
67-
singleQuote: true,
68-
bracketSpacing: false,
69-
arrowParens: 'avoid',
70-
},
71-
],
72-
strict: 'off',
73-
'sort-imports-es6-autofix/sort-imports-es6': [
74-
'error',
75-
{
76-
ignoreCase: false,
77-
ignoreMemberSort: false,
78-
memberSyntaxSortOrder: ['none', 'all', 'single', 'multiple'],
1+
import globals from 'globals';
2+
import importPlugin from 'eslint-plugin-import';
3+
import js from '@eslint/js';
4+
import prettier from 'eslint-plugin-prettier';
5+
import sortImportPlugin from 'eslint-plugin-sort-imports-es6-autofix';
6+
7+
export default [
8+
js.configs.recommended,
9+
importPlugin.flatConfigs.recommended,
10+
{
11+
name: 'planet/recommnded',
12+
plugins: {
13+
prettier,
14+
'sort-imports-es6-autofix': sortImportPlugin,
15+
},
16+
17+
languageOptions: {
18+
globals: {
19+
...globals.node,
20+
...globals.browser,
7921
},
80-
],
81-
'use-isnan': 'error',
82-
'valid-typeof': 'error',
22+
23+
ecmaVersion: 'latest',
24+
sourceType: 'module',
25+
},
26+
27+
rules: {
28+
'array-callback-return': 'error',
29+
'block-scoped-var': 'error',
30+
curly: 'error',
31+
'default-case': 'error',
32+
33+
'dot-notation': [
34+
'error',
35+
{
36+
allowPattern: '^[a-z]+(_[a-z]+)+$',
37+
},
38+
],
39+
40+
eqeqeq: 'error',
41+
'import/default': 'error',
42+
43+
'import/extensions': [
44+
'error',
45+
'always',
46+
{
47+
ignorePackages: true,
48+
},
49+
],
50+
51+
'import/first': 'error',
52+
'import/named': 'error',
53+
'import/no-duplicates': 'error',
54+
'import/no-self-import': 'error',
55+
56+
'import/no-unresolved': [
57+
'error',
58+
{
59+
commonjs: true,
60+
},
61+
],
62+
63+
'no-case-declarations': 'error',
64+
'no-cond-assign': 'error',
65+
'no-console': 'error',
66+
'no-const-assign': 'error',
67+
'no-constant-binary-expression': 'error',
68+
'no-control-regex': 'error',
69+
'no-debugger': 'error',
70+
'no-delete-var': 'error',
71+
'no-dupe-args': 'error',
72+
'no-dupe-keys': 'error',
73+
'no-duplicate-case': 'error',
74+
'no-empty': 'error',
75+
'no-empty-character-class': 'error',
76+
'no-eq-null': 'error',
77+
'no-ex-assign': 'error',
78+
'no-extra-boolean-cast': 'error',
79+
'no-fallthrough': 'error',
80+
'no-func-assign': 'error',
81+
'no-inner-declarations': ['error', 'functions'],
82+
'no-invalid-regexp': 'error',
83+
'no-irregular-whitespace': 'error',
84+
'no-negated-in-lhs': 'error',
85+
'no-obj-calls': 'error',
86+
'no-octal': 'error',
87+
'no-param-reassign': 'error',
88+
'no-process-exit': 'off',
89+
'no-redeclare': 'error',
90+
'no-regex-spaces': 'error',
91+
'no-sparse-arrays': 'error',
92+
'no-undef': 'error',
93+
'no-underscore-dangle': 'off',
94+
'no-unexpected-multiline': 'error',
95+
'no-unreachable': 'error',
96+
'no-unsafe-finally': 'error',
97+
98+
'no-unused-vars': [
99+
'error',
100+
{
101+
ignoreRestSiblings: true,
102+
},
103+
],
104+
105+
'no-use-before-define': ['error', 'nofunc'],
106+
'no-var': 'error',
107+
'prefer-const': 'error',
108+
109+
'prettier/prettier': [
110+
'error',
111+
{
112+
singleQuote: true,
113+
bracketSpacing: false,
114+
arrowParens: 'avoid',
115+
},
116+
],
117+
118+
strict: 'off',
119+
120+
'sort-imports-es6-autofix/sort-imports-es6': [
121+
'error',
122+
{
123+
ignoreCase: false,
124+
ignoreMemberSort: false,
125+
memberSyntaxSortOrder: ['none', 'all', 'single', 'multiple'],
126+
},
127+
],
128+
129+
'use-isnan': 'error',
130+
'valid-typeof': 'error',
131+
},
83132
},
84-
};
133+
];

0 commit comments

Comments
 (0)