https://github.com/cellular/cellular-lint
CLI toolbox for linting projects
https://github.com/cellular/cellular-lint
Last synced: about 1 year ago
JSON representation
CLI toolbox for linting projects
- Host: GitHub
- URL: https://github.com/cellular/cellular-lint
- Owner: cellular
- License: mit
- Created: 2018-02-09T16:38:43.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2022-05-27T19:09:09.000Z (about 4 years ago)
- Last Synced: 2025-03-21T16:21:25.216Z (over 1 year ago)
- Language: JavaScript
- Size: 1.47 MB
- Stars: 2
- Watchers: 0
- Forks: 1
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# cellular-lint
[](https://travis-ci.org/cellular/cellular-lint) [](https://greenkeeper.io/)
CLI toolbox for linting projects
## Usage
Add the following script to your package.json:
```json
{
"scripts": {
"lint": "cellular-lint",
"precommit": "cellular-lint-staged"
}
}
```
__NOTE:__ This package includes [husky](https://github.com/typicode/husky) which will install a Git-hook that executes the `precommit` script upon commits.
## Binaries
### `cellular-lint`
Runs ESLint. If the project does not have any ESLint config, the following defaults are used instead:
```json
{
"extends": ["cellular"]
}
```
__NOTE:__ This package has a `postinstall` script that will create a `.eslintrc` file with the defaults from above if the project does not contain any custom config.
### `cellular-lint-staged`
Runs lint-staged with the folloing settigns:
```js
{
linters: {
'**/*.+(js|mjs|jsx)': [
'cellular-lint --fix',
'cellular-flow focus-check', // if flow is present
'git add'
]
}
}
```
__NOTE:__ If the project contains a `.lintstagedrc` or `lint-staged.config.js` file that config will be used instead.
### `cellular-flow`
This is just a wrapper around the `flow` binary. Why? It's not uncommon for projects to contain an npm script called "flow". If such a script exists, lint-staged will run this instead of the actual flow binary which would prevent `flow focus-check` from working! To fix this we use `cellular-flow` as alias in our lint-staged configuration.
# License
MIT