0.0.7 ⢠Published 2 years ago
eslint-plugin-course-test-plugin v0.0.7
eslint-plugin-course-test-plugin
ESLint path checker plugin
Installation
You'll first need to install ESLint:
npm i eslint --save-dev
Next, install eslint-plugin-course-test-plugin
:
npm install eslint-plugin-course-test-plugin --save-dev
Usage
Add course-test-plugin
to the plugins section of your .eslintrc
configuration file. You can omit the eslint-plugin-
prefix:
{
"plugins": [
"course-test-plugin"
]
}
Then configure the rules you want to use under the rules section.
{
"rules": {
"course-test-plugin/path-checker": "error",
"course-test-plugin/public-api-imports": "error"
}
}
Folders that will be checked by default
path-checker
- entities, features, shared, widgets, pages
public-api-imports
- entities, features, widgets, pages
Custom
Also, you can configure the rules more dynamically.
- Add aliases
- Add custom folders name for checking only these folders.
{
"rules": {
"course-test-plugin/path-checker": [
"error",
{
"alias": "@"
},
[
"pages",
"modules",
"components",
"...otherFolders"
]
],
"course-test-plugin/public-api-imports": [
"error",
{
"alias": "@"
},
[
"pages",
"modules",
"components",
"...otherFolders"
]
]
}
}
Rules
š§ Automatically fixable by the --fix
CLI option.
Name | Description | š§ |
---|---|---|
path-checker | Architecture relative path checker | |
public-api-imports | Check correct using of public api | š§ |