Welcome to the eslint-plugin-path-supervisor repository! This ESLint plugin helps you enforce rules related to absolute and relative path usage, as well as public API imports in your projects. With this tool, you can maintain a clean and organized codebase, ensuring that your imports follow best practices.
- Absolute and Relative Path Enforcement: Ensure that your imports use the correct path type.
- Public API Imports: Easily manage and validate imports from your public API.
- Customizable Rules: Tailor the rules to fit your project's needs.
- Integration with ESLint: Works seamlessly with your existing ESLint setup.
To install the plugin, run the following command in your terminal:
npm install eslint-plugin-path-supervisor --save-dev
This command adds the plugin to your development dependencies. Once installed, you can start using it in your ESLint configuration.
To use the plugin, you need to add it to your ESLint configuration file. Here’s how you can do that:
- Open your ESLint configuration file (e.g.,
.eslintrc.js
). - Add
path-supervisor
to theplugins
section. - Enable the rules you want to use.
Here’s an example configuration:
module.exports = {
plugins: [
'path-supervisor'
],
rules: {
'path-supervisor/absolute-paths': 'error',
'path-supervisor/public-api-imports': 'warn'
}
};
You can customize the behavior of the plugin by modifying the rules in your ESLint configuration. Each rule comes with its own set of options, allowing you to tailor it to your specific needs.
For example, you can set the absolute-paths
rule to allow certain directories:
rules: {
'path-supervisor/absolute-paths': ['error', { allow: ['src', 'lib'] }]
}
The plugin includes several rules to help you manage your imports effectively. Here are some of the key rules:
- absolute-paths: Enforces the use of absolute paths in imports.
- relative-paths: Enforces the use of relative paths in imports.
- public-api-imports: Validates imports from your public API.
Each rule can be configured with specific options to meet your project requirements.
We welcome contributions to the eslint-plugin-path-supervisor! If you would like to contribute, please follow these steps:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Make your changes and ensure they pass the tests.
- Submit a pull request.
Please make sure to follow the coding standards and guidelines outlined in the project.
This project is licensed under the MIT License. See the LICENSE file for more details.
For the latest releases and updates, please visit the Releases section. Here, you can download and execute the necessary files for your project.
You can also check the Releases section for more information.
import MyComponent from 'src/components/MyComponent';
import MyComponent from '../../components/MyComponent'; // This will trigger a linting error
ESLint is a static code analysis tool for identifying problematic patterns in JavaScript code. It helps developers write cleaner, more maintainable code.
This plugin helps you enforce consistent import paths in your projects. It reduces confusion and potential errors when managing imports.
Yes, you can customize the rules to fit your project's specific needs. Check the configuration section for more details.
If you encounter any issues, please open an issue in the GitHub repository. Provide as much detail as possible to help us resolve the problem.
Thank you to all contributors and users of this plugin. Your feedback and support help us improve and maintain the project.
For any questions or suggestions, feel free to reach out via GitHub issues or contact the maintainer directly.
This README provides a comprehensive overview of the eslint-plugin-path-supervisor. We hope it helps you get started with enforcing path rules in your projects!