Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 7c07c17

Browse filesBrowse files
authored
Merge pull request #579 from github/legacy-filenames
Go back to legacy eslint-filenames-plugin for <v9
2 parents 97908fc + 020bf50 commit 7c07c17
Copy full SHA for 7c07c17

File tree

Expand file treeCollapse file tree

7 files changed

+3537
-8
lines changed
Filter options
Expand file treeCollapse file tree

7 files changed

+3537
-8
lines changed

‎README.md

Copy file name to clipboardExpand all lines: README.md
+6-1Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,11 @@ export default [
5555
]
5656
```
5757

58+
> [!NOTE]
59+
> If you configured the `filenames/match-regex` rule, please note we have adapted the match regex rule into `eslint-plugin-github` as the original `eslint-filenames-plugin` is no longer maintained and needed an ESLint v9 update. Please update the name to `github/filenames-match-regex` and keep the same configuration. For e.g.:
60+
>
61+
> `'github/filenames-match-regex': ['error', '^[a-z0-9-]+(.[a-z0-9-]+)?$']`
62+
5863
The available configs are:
5964

6065
- `internal`
@@ -120,7 +125,7 @@ This config will be interpreted in the following way:
120125
| [async-currenttarget](docs/rules/async-currenttarget.md) | disallow `event.currentTarget` calls inside of async functions | 🔍 | | |
121126
| [async-preventdefault](docs/rules/async-preventdefault.md) | disallow `event.preventDefault` calls inside of async functions | 🔍 | | |
122127
| [authenticity-token](docs/rules/authenticity-token.md) | disallow usage of CSRF tokens in JavaScript | 🔐 | | |
123-
| [filenames-match-regex](docs/rules/filenames-match-regex.md) | ensure filenames match a regex naming convention | | | |
128+
| [filenames-match-regex](docs/rules/filenames-match-regex.md) | ensure filenames match a regex naming convention | | | |
124129
| [get-attribute](docs/rules/get-attribute.md) | disallow wrong usage of attribute names | 🔍 | 🔧 | |
125130
| [js-class-name](docs/rules/js-class-name.md) | enforce a naming convention for js- prefixed classes | 🔐 | | |
126131
| [no-blur](docs/rules/no-blur.md) | disallow usage of `Element.prototype.blur()` | 🔍 | | |

‎docs/rules/filenames-match-regex.md

Copy file name to clipboardExpand all lines: docs/rules/filenames-match-regex.md
+1-3Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
# Ensure filenames match a regex naming convention (`github/filenames-match-regex`)
22

3-
💼 This rule is enabled in the ✅ `recommended` config.
4-
53
<!-- end auto-generated rule header -->
64

75
## Rule Details
86

9-
Rule to ensure that filenames match a convention, with a default of camelCase.
7+
Rule to ensure that filenames match a convention, with a default of camelCase for ESLint v9+.
108

119
👎 Examples of **incorrect** filename for this default rule:
1210

‎lib/configs/recommended.js

Copy file name to clipboardExpand all lines: lib/configs/recommended.js
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ module.exports = {
88
env: {
99
es6: true,
1010
},
11-
plugins: ['github', 'prettier', 'eslint-comments', 'import', 'i18n-text', 'no-only-tests'],
11+
plugins: ['github', 'prettier', 'eslint-comments', 'import', 'filenames', 'i18n-text', 'no-only-tests'],
1212
rules: {
1313
'constructor-super': 'error',
1414
'eslint-comments/disable-enable-pair': 'off',
@@ -18,7 +18,7 @@ module.exports = {
1818
'eslint-comments/no-unused-disable': 'error',
1919
'eslint-comments/no-unused-enable': 'error',
2020
'eslint-comments/no-use': ['error', {allow: ['eslint', 'eslint-disable-next-line', 'eslint-env', 'globals']}],
21-
'github/filenames-match-regex': ['error', '^[a-z0-9-]+(.[a-z0-9-]+)?$'],
21+
'filenames/match-regex': ['error', '^[a-z0-9-]+(.[a-z0-9-]+)?$'],
2222
'func-style': ['error', 'declaration', {allowArrowFunctions: true}],
2323
'github/array-foreach': 'error',
2424
'github/no-implicit-buggy-globals': 'error',

‎package-lock.json

Copy file name to clipboardExpand all lines: package-lock.json
+3-2Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json

Copy file name to clipboardExpand all lines: package.json
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,13 @@
3535
"@eslint/eslintrc": "^3.1.0",
3636
"@eslint/js": "^9.14.0",
3737
"@github/browserslist-config": "^1.0.0",
38+
"@typescript-eslint/eslint-plugin": "^8.0.0",
39+
"@typescript-eslint/parser": "^8.0.0",
3840
"aria-query": "^5.3.0",
3941
"eslint-config-prettier": ">=8.0.0",
4042
"eslint-plugin-escompat": "^3.11.3",
4143
"eslint-plugin-eslint-comments": "^3.2.0",
44+
"eslint-plugin-filenames": "^1.3.2",
4245
"eslint-plugin-i18n-text": "^1.0.1",
4346
"eslint-plugin-import": "^2.25.2",
4447
"eslint-plugin-jsx-a11y": "^6.7.1",

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.