Skip to content

Commit c9d0514

Browse files
Copilotjoshblack
andcommitted
Fix eslint.config.js to include eslint:recommended and plugin:github/recommended configs and update typescript-eslint parser usage
Co-authored-by: joshblack <[email protected]>
1 parent 5ea0b6a commit c9d0514

File tree

5 files changed

+32
-9
lines changed

5 files changed

+32
-9
lines changed

.markdownlint-cli2.cjs

Lines changed: 2 additions & 2 deletions
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

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
'use strict'
22

3+
const js = require('@eslint/js')
34
const globals = require('globals')
5+
const github = require('eslint-plugin-github')
46

57
/**
68
* @type {import('eslint').Linter.FlatConfig[]}
@@ -9,6 +11,8 @@ module.exports = [
911
{
1012
ignores: ['node_modules/**', '.git/**'],
1113
},
14+
js.configs.recommended,
15+
github.default.getFlatConfigs().recommended,
1216
{
1317
languageOptions: {
1418
ecmaVersion: 'latest',
@@ -19,15 +23,18 @@ module.exports = [
1923
},
2024
},
2125
rules: {
22-
// Basic rules for the repository
26+
// Override specific rules for the repository
27+
'import/no-commonjs': 'off',
28+
'import/no-dynamic-require': 'off', // Allow dynamic requires in tests
29+
'no-shadow': 'off',
2330
'no-unused-vars': [
2431
'error',
2532
{
2633
varsIgnorePattern: '^_',
2734
},
2835
],
29-
'no-shadow': 'off',
30-
'no-undef': 'error',
36+
'github/filenames-match-regex': 'off', // Allow various file naming patterns
37+
'i18n-text/no-en': 'off', // Allow English text in this repository
3138
},
3239
},
3340
{

package-lock.json

Lines changed: 12 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,14 @@
4848
"@types/jest": "^30.0.0",
4949
"@typescript-eslint/rule-tester": "8.38.0",
5050
"eslint": "^9.0.0",
51-
"eslint-plugin-prettier": "^5.2.1",
52-
"jest": "^30.0.5",
51+
"eslint-plugin-eslint-comments": "^3.2.0",
52+
"eslint-plugin-filenames": "^1.3.2",
53+
"eslint-plugin-i18n-text": "^1.0.1",
54+
"eslint-plugin-import": "^2.32.0",
55+
"eslint-plugin-no-only-tests": "^3.3.0",
56+
"eslint-plugin-prettier": "^5.5.4",
5357
"globals": "^16.3.0",
58+
"jest": "^30.0.5",
5459
"markdownlint-cli2": "^0.18.1",
5560
"markdownlint-cli2-formatter-pretty": "^0.0.7"
5661
},

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const asConstDeclaration = `const as = "p";`
2121

2222
const ruleTester = new RuleTester({
2323
languageOptions: {
24-
parser: require(require.resolve('@typescript-eslint/parser', {paths: [require.resolve('eslint-plugin-github')]})),
24+
parser: require('@typescript-eslint/parser'),
2525
parserOptions: {
2626
tsconfigRootDir: path.resolve(__dirname, 'fixtures'),
2727
project: path.resolve(__dirname, 'fixtures', 'tsconfig.json'),

0 commit comments

Comments
 (0)