Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/codica2/eslint-config-codica
This package provides Codica's .eslintrc as an extensible shared config.
https://github.com/codica2/eslint-config-codica
eslint eslint-config prettier prettier-eslint
Last synced: about 4 hours ago
JSON representation
This package provides Codica's .eslintrc as an extensible shared config.
- Host: GitHub
- URL: https://github.com/codica2/eslint-config-codica
- Owner: codica2
- Created: 2019-04-23T10:32:18.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-04-27T12:35:56.000Z (over 1 year ago)
- Last Synced: 2024-04-26T16:42:03.482Z (6 months ago)
- Topics: eslint, eslint-config, prettier, prettier-eslint
- Language: JavaScript
- Size: 191 KB
- Stars: 6
- Watchers: 3
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# eslint-config-codica
This package provides Codica's .eslintrc as an extensible shared config.
## Usage
## eslint-config-codica
### Install the config via `npm`
```bash
npm install eslint-config-codica --save-dev
```### or via `yarn`
```bash
yarn add -D eslint-config-codica
```### Extend our config in your `.eslintrc` file:
```json
{
"extends": ["codica"]
}
```Our config based on [airbnb](https://github.com/airbnb/javascript/tree/master/packages/eslint-config-airbnb) including some rewrites for ES6+ and React with [config-prettier](https://github.com/prettier/eslint-config-prettier) onboard. It requires `eslint`, `eslint-plugin-import`, `eslint-plugin-prettier`, `eslint-plugin-react`, and `eslint-plugin-jsx-a11y`.
To be sure, that you're using correct version of each package, you can list them by the command:
```bash
npm info "eslint-config-codica@latest" peerDependencies
```If you don't need a `React` and `Prettier` onboard - `eslint-config-codica-base` and `eslint-config-codica-react` is coming soon!
## Recommendations
### Code formatting with Prettier
This config includes `eslint-config-prettier` and `eslint-config-prettier/react`. To feel up all advantages of automatic code formatting just add [prettier](https://prettier.io) to your project.
```bash
yarn add -D prettier
```and add `.prettierrc` to your project root with such a config to avoid conflicts with `airbnb` and `prettier` eslint configs.
```json
{
"singleQuote": true,
"trailingComma": "all"
}
```### Pre-commit hooks
The nice way to make your teammates or/and outstuff developers to push only valid and pretty code is to use pre-commit hooks using [lint-staged](https://github.com/okonet/lint-staged) and [husky](https://github.com/typicode/husky).
The configuration steps is next:
1. Install packages:
```bash
yarn add -D husky lint-staged
```2. Add some configuration to `rc` files or to `package.json` directly:
```json
{
...
"scripts": {
...
"lint:write": "./node_modules/.bin/eslint --debug . --fix",
"prettier": "./node_modules/.bin/prettier --write ./**/*.js"
},
"lint-staged": {
"*.(js|jsx)": [
"yarn lint:write",
"git add"
]
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
}
}
```3. You are beautiful! Next time you'll try to commit something, husky will hook up your commit and run `eslint` to validate all the new code!
## License
eslint-config-codica is Copyright © 2015-2019 Codica. It is released under the [MIT License](https://opensource.org/licenses/MIT).
## About Codica
[![Codica logo](https://www.codica.com/assets/images/logo/logo.svg)](https://www.codica.com)
We love open source software! See [our other projects](https://github.com/codica2) or [hire us](https://www.codica.com/) to design, develop, and grow your product.