Skip to content

Commit 5651ac3

Browse files
committed
Get npm run lint working
1 parent a8a8b66 commit 5651ac3

7 files changed

+75
-34
lines changed

.eslintignore

-2
This file was deleted.

.markdownlint-cli2.cjs

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ const options = githubMarkdownOpinions.init({
1616
'no-hard-tabs': false,
1717
'first-line-heading': false,
1818
'no-space-in-emphasis': false,
19-
'blanks-around-fences': false
19+
'blanks-around-fences': false,
2020
})
2121

2222
module.exports = {
2323
config: options,
2424
customRules: ['@github/markdownlint-github'],
25-
outputFormatters: [['markdownlint-cli2-formatter-pretty', {appendLink: true}]]
25+
outputFormatters: [['markdownlint-cli2-formatter-pretty', {appendLink: true}]],
2626
}

eslint.config.js

+31-21
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,23 @@
1-
const eslintPlugin = require('eslint-plugin-eslint-plugin')
1+
const eslintJs = require('@eslint/js')
22
const github = require('eslint-plugin-github')
3+
const globals = require('globals')
4+
const pluginJest = require('eslint-plugin-jest')
35

46
module.exports = [
57
github.getFlatConfigs().recommended,
6-
eslintPlugin.configs['flat/recommended'],
8+
eslintJs.configs.recommended,
79
{
810
languageOptions: {
911
parserOptions: {
1012
ecmaVersion: 'latest',
1113
},
12-
},
13-
env: {
14-
commonjs: true,
15-
node: true,
14+
globals: {
15+
...globals.commonjs,
16+
...globals.node,
17+
},
1618
},
1719
rules: {
18-
'import/no-commonjs': 'off',
20+
'importPlugin/no-commonjs': 'off',
1921
'no-shadow': 'off',
2022
'no-unused-vars': [
2123
'error',
@@ -24,19 +26,27 @@ module.exports = [
2426
},
2527
],
2628
},
27-
overrides: [
28-
{
29-
files: ['**/*.test.js'],
30-
env: {
31-
jest: true,
32-
},
33-
},
34-
{
35-
files: ['.eslintrc.js'],
36-
rules: {
37-
'filenames/match-regex': 'off',
38-
},
29+
ignores: ['**/dist/**', '**/node_modules/**'],
30+
},
31+
{
32+
files: ['**/*.test.js'],
33+
languageOptions: {
34+
globals: {
35+
...pluginJest.environments.globals.globals,
3936
},
40-
],
41-
}
37+
},
38+
},
39+
{
40+
files: ['.eslint.config.js', '.markdownlint-cli2.cjs'],
41+
rules: {
42+
'filenames/match-regex': 'off',
43+
'github/filenames-match-regex': 'off',
44+
},
45+
},
46+
{
47+
files: ['src/url.js', 'src/rules/new-color-css-vars.js'],
48+
rules: {
49+
'importPlugin/extensions': 'off',
50+
},
51+
},
4252
]

package-lock.json

+38-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+2
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@
4343
"@github/markdownlint-github": "^0.6.3",
4444
"@github/prettier-config": "0.0.6",
4545
"eslint": "^9.16.0",
46+
"@eslint/js": "^9.16.0",
47+
"eslint-plugin-jest": "^28.9.0",
4648
"eslint-plugin-prettier": "^5.2.1",
4749
"jest": "^29.7.0",
4850
"markdownlint-cli2": "^0.14.0",

src/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,5 @@ module.exports = {
2424
configs: {
2525
recommended: require('./configs/recommended'),
2626
},
27-
getFlatConfigs: getFlatConfigs
27+
getFlatConfigs,
2828
}

src/rules/__tests__/no-unnecessary-components.test.js

+1-7
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,9 @@ const ruleTester = new RuleTester({
2525
parser: tseslint.parser,
2626
parserOptions: {
2727
tsconfigRootDir: path.resolve(__dirname, 'fixtures'),
28-
projectService: {
29-
allowDefaultProject: ['*.ts*'],
30-
},
28+
project: path.resolve(__dirname, 'fixtures', 'tsconfig.json')
3129
},
3230
},
33-
defaultFilenames: {
34-
ts: 'file.ts',
35-
tsx: 'File.tsx',
36-
},
3731
})
3832

3933
jest.retryTimes(0, {logErrorsBeforeRetry: true})

0 commit comments

Comments
 (0)