@chaos-theory/eslint-config

1.0.8 • Public • Published

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 your eslintrc.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.

Readme

Keywords

Package Sidebar

Install

npm i @chaos-theory/eslint-config

Weekly Downloads

61

Version

1.0.8

License

MIT

Unpacked Size

8.17 kB

Total Files

9

Last publish

Collaborators

  • sohail-chaos