1.0.0 • Published 1 year ago

eslint-config-lzinik v1.0.0

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

eslint-config

ESLint configuration

About

This package includes 4 ESLint shareable configs:

  1. Base: Configures general rules and the ones that come in the import and prettier eslint plugins
  2. TypeScript: Configures typescript parser and typescript eslint plugin (This config requires in addition of extending from it to configure parserOptions.project in the eslint configuration file).
  3. React: Configures react related rules (react and react-hooks eslint plugins)
  4. Next: Configures next.js related rules (next eslint config)

Installation

Using npm

$ npm install --save-dev lzinik/eslint-config

Using yarn

$ yarn add --dev lzinik/eslint-config

Usage

  1. Create a project eslint configuration file (.eslintrc.js)
  2. Depending on the use case, extend from the corresponding config(s)

Use cases

  • Pure JS project: extend from Base
module.exports = {
  extends: ["lzinik/eslint-config/dist/base"]
};
  • Pure TS project: extend from TypeScript and configure parserOptions.project value
module.exports = {
  "parserOptions": {
    "project": "./tsconfig.json"
  },
  extends: ["lzinik/eslint-config/dist/typescript"]
};
module.exports = {
  extends: ["lzinik/eslint-config/dist/base", "lzinik/eslint-config/dist/react"]
};
  • React TS project: extend from Typescript, React and configure parserOptions.project value and
module.exports = {
  "parserOptions": {
    "project": "./tsconfig.json"
  },
  extends: ["lzinik/eslint-config/dist/typescript", "lzinik/eslint-config/dist/react"]
};
  • Next JS project: extend from Base and Next
module.exports = {
  extends: ["lzinik/eslint-config/dist/base", "lzinik/eslint-config/dist/next"]
};
  • Next TS project: extend from TypeScript, Next and configure parserOptions.project value
module.exports = {
  "parserOptions": {
    "project": "./tsconfig.json"
  },
  extends: ["lzinik/eslint-config/dist/typescript", "lzinik/eslint-config/dist/next"]
};