Skip to content

Commit

Permalink
fix(deps): add filename eslint plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
crisfcodes committed Jan 11, 2022
1 parent f6c7faa commit b4cf8b7
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 1 deletion.
18 changes: 18 additions & 0 deletions filenames.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
module.exports = {
plugins: ['filenames'],

rules: {
'filenames/match-regex': [
'error',
'^\\.?[a-z-]+\\.?(config|test|queries|types)?\\.?(d)?$',
true,
],
'filenames/match-exported': [
'error',
'kebab',
'\\.(config|test|queries|types)$',
true,
],
'filenames/no-index': 'off',
},
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
"@typescript-eslint/parser": "^5.3.1",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-filenames": "^1.3.2",
"eslint-plugin-import": "^2.24.2",
"eslint-plugin-jest": "^24.4.0",
"eslint-plugin-jest-dom": "^3.9.0",
Expand Down
8 changes: 7 additions & 1 deletion samples/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
module.exports = {
extends: ['../react.js', '../jsx-a11y.js', '../index.js', '../jest.js'],
extends: [
'../react.js',
'../jsx-a11y.js',
'../index.js',
'../jest.js',
'../filenames.js',
],
overrides: [
{
files: ['**/*.ts?(x)'],
Expand Down

0 comments on commit b4cf8b7

Please sign in to comment.