Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mourner/eslint-config-mourner
A strict ESLint config for my JavaScript projects
https://github.com/mourner/eslint-config-mourner
Last synced: 15 days ago
JSON representation
A strict ESLint config for my JavaScript projects
- Host: GitHub
- URL: https://github.com/mourner/eslint-config-mourner
- Owner: mourner
- Created: 2015-09-23T14:31:13.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2024-07-10T20:32:21.000Z (4 months ago)
- Last Synced: 2024-09-16T13:44:43.925Z (about 2 months ago)
- Language: JavaScript
- Homepage:
- Size: 46.9 KB
- Stars: 19
- Watchers: 36
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## eslint-config-mourner
A great [ESLint](http://eslint.org/) config with sensible defaults
that I use in [all my JavaScript projects](https://github.com/mourner/projects).It is meant to be _strict_, enforcing as many useful rules and conventions as possible
to keep the code clean, elegant and consistent across projects.The rules are easy to follow, so this is a good starting place for new projects,
while being easy to disable on a case by case basis for existing projects
if you want to enforce and fix them gradually or have justified exceptions.### Install
To use it in your project, run:
```bash
npm install --save-dev eslint eslint-config-mourner
```Then add a following `eslint.config.js` file in the repo root (assuming the package is `type: "module"`):
```js
import config from "eslint-config-mourner";export default [
...config,// your overrides if needed
{
rules: {
"camelcase": "warn"
}
}
];
```Finally, add `eslint` to a `package.json` script:
```json
"scripts": {
"lint": "eslint index.js test/test*.js",
"pretest": "npm run lint"
}
```Now run `npm run lint` and enjoy all the errors! :)
### Automatic fixes
To make things easier, you can run `eslint` with `--fix` option
that automatically fixes all simple errors like indentation and quotes for you.