From c027e6e9f7d2497f5f8e6fa1c57c47fe83978dd5 Mon Sep 17 00:00:00 2001 From: Ned Schwartz Date: Mon, 5 Dec 2022 17:40:13 -0500 Subject: [PATCH] generalize `filenames/match-regex` to allow any 'extension prefix' 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. --- lib/configs/recommended.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/configs/recommended.js b/lib/configs/recommended.js index ee516bb9..67233c13 100644 --- a/lib/configs/recommended.js +++ b/lib/configs/recommended.js @@ -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',