Skip to content

Commit 5739553

Browse files
authored
Merge pull request #531 from sir-gon/develop
Develop
2 parents f7416fa + f2ad583 commit 5739553

9 files changed

+334
-138
lines changed

.eslintignore

-3
This file was deleted.

.eslintrc

-80
This file was deleted.

.github/workflows/eslint.yml

+4-2
Original file line numberDiff line numberDiff line change
@@ -54,18 +54,20 @@ jobs:
5454
run: |
5555
npm install --include=dev [email protected]
5656
npm install --include=dev @microsoft/[email protected]
57+
5758
- name: Test ESLint
5859
run: |
5960
npx --yes eslint --env-info
61+
6062
- name: Run ESLint
6163
run: >
6264
npx eslint .
63-
--config .eslintrc
65+
--color
6466
--max-warnings=0
65-
--ext .js,.jsx,.ts,.tsx
6667
--format @microsoft/eslint-formatter-sarif
6768
--output-file eslint-results.sarif
6869
continue-on-error: true
70+
6971
- name: Upload analysis results to GitHub
7072
uses: github/codeql-action/upload-sarif@v3
7173
with:

Dockerfile

+1-2
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@ COPY ./Makefile ${WORKDIR}/
3939
# code linting conf
4040
COPY ./.prettierrc ${WORKDIR}/
4141
COPY ./.prettierignore ${WORKDIR}/
42-
COPY ./.eslintrc ${WORKDIR}/
43-
COPY ./.eslintignore ${WORKDIR}/
42+
COPY ./eslint.config.js ${WORKDIR}/
4443
COPY ./.babelrc ${WORKDIR}/
4544

4645
# markdownlint conf

eslint.config.js

+102
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
import { fixupConfigRules, fixupPluginRules } from '@eslint/compat';
2+
import _import from 'eslint-plugin-import';
3+
import jest from 'eslint-plugin-jest';
4+
import prettier from 'eslint-plugin-prettier';
5+
import globals from 'globals';
6+
import babelParser from '@babel/eslint-parser';
7+
import path from 'node:path';
8+
import { fileURLToPath } from 'node:url';
9+
import js from '@eslint/js';
10+
import { FlatCompat } from '@eslint/eslintrc';
11+
12+
const __filename = fileURLToPath(import.meta.url);
13+
const __dirname = path.dirname(__filename);
14+
const compat = new FlatCompat({
15+
baseDirectory: __dirname,
16+
recommendedConfig: js.configs.recommended,
17+
allConfig: js.configs.all
18+
});
19+
20+
export default [
21+
js.configs.recommended,
22+
{
23+
ignores: ['**/coverage', '**/dist', '**/node_modules', 'eslint.config.js']
24+
},
25+
...fixupConfigRules(
26+
compat.extends(
27+
'eslint:recommended',
28+
'airbnb-base',
29+
'prettier',
30+
'plugin:jest/all'
31+
)
32+
),
33+
{
34+
plugins: {
35+
import: fixupPluginRules(_import),
36+
jest: fixupPluginRules(jest),
37+
prettier
38+
},
39+
40+
languageOptions: {
41+
globals: {
42+
...globals.node,
43+
...jest.environments.globals.globals
44+
},
45+
46+
parser: babelParser,
47+
ecmaVersion: 2022,
48+
sourceType: 'module',
49+
50+
parserOptions: {
51+
requireConfigFile: false,
52+
53+
babelOptions: {
54+
parserOpts: {
55+
plugins: ['importAssertions']
56+
}
57+
}
58+
}
59+
},
60+
61+
rules: {
62+
'prettier/prettier': ['error'],
63+
'no-restricted-syntax': 0,
64+
'no-console': 'off',
65+
'no-underscore-dangle': 0,
66+
67+
'no-plusplus': [
68+
'error',
69+
{
70+
allowForLoopAfterthoughts: true
71+
}
72+
],
73+
74+
'import/no-unresolved': [
75+
2,
76+
{
77+
commonjs: true,
78+
amd: true
79+
}
80+
],
81+
82+
'import/extensions': [
83+
'error',
84+
{
85+
js: 'always',
86+
json: 'always'
87+
}
88+
],
89+
90+
'import/no-extraneous-dependencies': [
91+
'error',
92+
{
93+
devDependencies: [
94+
'**/*.test.js',
95+
'**/*.bruteforce-test.js',
96+
'**/*.spec.js'
97+
]
98+
}
99+
]
100+
}
101+
}
102+
];

0 commit comments

Comments
 (0)