Skip to content

Commit

Permalink
generalize filenames/match-regex to allow any 'extension prefix'
Browse files Browse the repository at this point in the history
For example, `file-name.server.tsx`, `file-name.d.ts`, `file-name.config.json`

This allows any of the following:

file-name
file-name.d
file-name.config
file-name.server
file-name.wild-card

Note that the file extension is not part of the regex.

I made this change because we are seeing more and more of this style of 'extension prefix` convention.
  • Loading branch information
theinterned committed Dec 6, 2022
1 parent 1d1e833 commit c027e6e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/configs/recommended.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ module.exports = {
'eslint-comments/no-unused-disable': 'error',
'eslint-comments/no-unused-enable': 'error',
'eslint-comments/no-use': ['error', {allow: ['eslint', 'eslint-disable-next-line', 'eslint-env', 'globals']}],
'filenames/match-regex': ['error', '^[a-z0-9-]+(.d|.config|.server)?$'],
'filenames/match-regex': ['error', '^[a-z0-9-]+(.[a-z0-9-]+)?$'],
'func-style': ['error', 'declaration', {allowArrowFunctions: true}],
'github/array-foreach': 'error',
'github/no-implicit-buggy-globals': 'error',
Expand Down

0 comments on commit c027e6e

Please sign in to comment.