@chaos-theory/eslint-config
v1.0.8
Published
Set of eslint configs and rules recommended by Chaos Theory for React React Native and NodeJS projects. These have been chunked into React, Imports, Promises etc.
Downloads
202
Readme
Chaos Theory Eslint Config
Installation
1. Install the package and related libraries
yarn add -D @chaos-theory/eslint-config eslint-plugin-prettier eslint-plugin-react eslint-plugin-promise @typescript-eslint/eslint-plugin
NOTE: This library requires eslint >= 8
to work
2. Add the library to local eslintrc.js file
module.exports = {
extends: [
'@chaos-theory/eslint-config',
'@chaos-theory/eslint-config/react-native',
'@chaos-theory/eslint-config/import',
'@chaos-theory/eslint-config/promise',
],
}
@chaos-theory/eslint-config
base config with general rules@chaos-theory/eslint-config/react
for react projects.@chaos-theory/eslint-config/react-native
for react native projects (this include@chaos-theory/eslint-config/react
)@chaos-theory/eslint-config/import
for import rules. You can override the import order rule by updating your rules locally in youreslintrc.js
// Example
'import/order': [
'error',
{
'newlines-between': 'always',
pathGroups: [
{
pattern:
'{@config,@gql-types,@assets/**,@ui/**,@features/**,@util/**,@styles/**,@services/**,@constants/**,@navigation/**,@hooks/**,@redux/**,@containers/**,@components/**,@types/**}',
group: 'external',
position: 'after',
},
],
pathGroupsExcludedImportTypes: ['builtin'],
alphabetize: {
order: 'asc',
caseInsensitive: true,
},
groups: [['builtin', 'external'], 'internal', ['parent', 'sibling', 'index']],
},
],
@chaos-theory/eslint-config/promise
for promise rules.
Contribution
- Create an issue with requested rule / bug.
- Create a PR and once approved, merge into master
Release
- Trigger github action to Create release PR.
- Merged the automated PR: This will trigger
npm publish
to publish the version to npm.