ESLint plugin that always reports with configurable message
npm install eslint-plugin-chalk[![NPM version][npm-image]][npm-url] [![Downloads][npm-downloads-image]][npm-url] [![star this repo][gh-stars-image]][gh-url] [![fork this repo][gh-forks-image]][gh-url] [![Build Status][gh-status-image]][gh-url]
> ESLint plugin that always reports with configurable message
> The project is based on eslint-plugin-always but not output with warn or error, it makes the plugin won't interrupt the check process.
It sounds a bit strange to have a ESLint rule that always reports. The reason why this plugin was created is a special use case:
The root ESLint configuration in the project fits for the build scripts but not for the rest of the project.
There is a subfolder that resets the ESLint configuration:
``json`
{
"root": true
}
So all files in this folder structure won't check any ESLint rules.
The subfolders must contain ESLint configurations which can differ between each subfolder.
For the case that someone adds a subfolder and forgets the ESLint configuration this rule was created. So every file within the subfolder will report an error
> No ESLint configuration present.
`sh`
$ npm i -D eslint-plugin-chalk
Add the plugin to your ESLint configuration:
`json`
{
"plugins": [
"chalk"
]
}
And then add the following rule:
`json``
{
"rules": {
"chalk/chalk": ["error", {
"hexColor": "#00f",
"icon": "💡",
"message": "Hello World"
}]
}
}
MIT © 2022 Jens Simon & XQ Kuang
[npm-url]: https://www.npmjs.com/package/eslint-plugin-chalk
[npm-image]: https://badgen.net/npm/v/eslint-plugin-chalk
[npm-downloads-image]: https://badgen.net/npm/dw/eslint-plugin-chalk
[gh-url]: https://github.com/xuqingkuang/eslint-plugin-chalk
[gh-stars-image]: https://badgen.net/github/stars/xuqingkuang/eslint-plugin-chalk
[gh-forks-image]: https://badgen.net/github/forks/xuqingkuang/eslint-plugin-chalk
[gh-status-image]: https://badgen.net/github/status/xuqingkuang/eslint-plugin-chalk