1.1.0 • Published 1 year ago
eslint-config-litcharts-shared v1.1.0
LitCharts ESLint Config
Installation
- Install the library:
yarn add --dev eslint-config-litcharts
- Install dev dependencies:
yarn add --dev eslint@^6.8 eslint-plugin-import eslint-plugin-jsx-a11y eslint-plugin-react eslint-plugin-react-hooks@^2.5.0
- Add
"extends": "eslint-config-litcharts"
to the.eslintrc
file, or"extends": "eslint-config-litcharts/react-native"
for react native.
Development
Once you've made changes and want to test them locally, do the following steps. See the docs for more info.
yarn link
- Then, in your project that wants to use your shareable config, type:
yarn link eslint-config-litcharts
- Be sure to unlink in other projects when done via
yarn unlink eslint-config-litcharts
so the proper package frompackage.json
is used.
Linting
The base linting rules come from airbnb's shared linting package.
React Native specific rules come from eslint-config-react-native.
Changing rules
To overwrite rules that you don't like, add the specific rule to rules/sharedRules
for all configs or rules/nativeRules
for React Native specific rules. Create a PR so we can discuss if we like semicolons or not.
Prettier
See prettier docs prettier.
- Install prettier on your word editor
- In
package.json
add a"prettier": "eslint-config-litcharts/prettier-config"
line.
TODO
- Add eslint-jest: https://www.npmjs.com/package/eslint-plugin-jest
- Any kind of precommit hooks using something like
husky
?