Modify your.eslintrcfile to load the plugin and enable the rules you want to use. { "plugins":[ "filenames" ], "rules":{ "filenames/match-regex":2, "filenames/match-exported":2, "filenames/no-index":2 } } Rules Consistent Filenames via regex (match-regex) ...
eslint>=1.0.0 to be installed as a peer dependency. Modify your .eslintrc file to load the plugin and enable the rules you want to use.{ "plugins": [ "filenames" ], "rules": { "filenames/match-regex": 2, "filenames/match-exported": 2, "filenames/no-index": 2 } }...
npm i --save-dev eslint eslint-plugin-filenames-simple#oryarn add -D eslint eslint-plugin-filenames-simple Modify your.eslintrcfile to load the plugin and enable the rules. // select one of the following{"extends":["plugin:filenames-simple/recommended"// for pure ECMAScript/TypeScri...
eslint-plugin-unnecessary-filename-in-import ESLint 规则要求 import 语句仅引用模块的目录 如果模块名称和文件名称相同,则代替文件。 当每个模块都有一个将“main”设置为模块主文件的package.json时,这很有用。 某些IDE 无法识别package.json的存在并使用文件名创建导入语句。 您可以提供选项{ "skipPackageJsonCh...
Add to your ESLint config:{ "plugins": ["eslint-plugin-filename-export"], "rules": { "filename-export/match-named-export": "error", "filename-export/match-default-export": "error" } }Rulesfilename-export/match-named-export - Enforces that the filename matches to a named export. ...
I was able to selectively disable this plugin based on the file path / name using https://github.com/mradionov/eslint-plugin-disable#file-paths Owner selaux commented Feb 20, 2017 To address your other problems, you can use a custom regex, something like (untested) "([A-Za-z][a-...
plugins: ['github', 'prettier', 'eslint-comments', 'import', 'i18n-text', 'no-only-tests'], plugins: ['github', 'prettier', 'eslint-comments', 'import', 'filenames', 'i18n-text', 'no-only-tests'], rules: { 'constructor-super': 'error', 'eslint-comments/disable-enable-pair...
eslint-plugin-unnecessary-filename-in-import ESLint rule to require import statements to only reference the directory of a module instead of the file if the name of the module and the file are the same. This is useful when each module has a package.json with "main" set to the modules ...