Open msgoloborodov opened 5 months ago
As an alternative, you can use eslint-plugin-project-structure
ESLint plugin with rules to help you achieve a scalable, consistent, and well-structured project.
Create your own framework! Define your folder structure, advanced naming conventions, file composition, and create independent modules.
Take your project to the next level and save time by automating the review of key principles of a healthy project!
Enforce rules on folder structure to keep your project consistent, orderly and well thought out.
A key principle of a healthy project is to prevent the creation of a massive dependency tree, where removing or editing one feature triggers a chain reaction that impacts the entire project.
Create independent modules to keep your project scalable and easy to maintain. Get rid of dependencies between modules and create truly independent functionalities.
Enforce advanced naming rules and prohibit the use of given selectors in a given file.
Have full control over what your file can contain and the naming conventions it must follow.
As the project is no longer being maintained, it doesn't look like we're going to be getting official support for this.
You can instead use the @eslint/compat
helper:
https://eslint.org/blog/2024/05/eslint-compatibility-utilities
import { fixupPluginRules } from '@eslint/compat';
import filenamesPlugin from 'eslint-plugin-filenames';
export default [
{
plugins: {
'filenames': fixupPluginRules(filenamesPlugin),
},
rules: {
'filenames/match-exported': 'error',
},
},
];
Worked for me!
In Eslint 9 meta.schema is required. Please add meta.schema to rules configs.
Also context.getFilename() now is property context.filename.