eslint-config-volue

15.2.0 • Public • Published

eslint-config-volue

Version npm

ESLint configuration presets for Volue projects.

Usage

Common

npm i -D eslint eslint-config-volue

Add to your .eslintrc

{
  "extends": "volue"
}

Babel

To use the Babel rule set:

npm i -D eslint eslint-config-volue @babel/eslint-parser

Add this to your .eslintrc:

{
  "extends": "volue/babel"
}

TypeScript

To use the TypeScript rule set:

npm i -D eslint eslint-config-volue @typescript-eslint/parser @typescript-eslint/eslint-plugin eslint-import-resolver-typescript

Add this to your .eslintrc:

{
  "extends": "volue/typescript"
}

React

To use the React rule set:

npm i -D eslint eslint-config-volue eslint-plugin-react eslint-plugin-react-hooks

Add this to your .eslintrc:

{
  "extends": "volue/react"
}

Import

To use the eslint-plugin-import rule set:

npm i -D eslint eslint-config-volue eslint-plugin-import

Add this to your .eslintrc:

{
  "extends": "volue/import"
}

Jest

To use the Jest rule set:

npm i -D eslint eslint-config-volue eslint-plugin-jest

Add this to your .eslintrc:

{
  "extends": "volue/jest"
}

css-modules

To use the eslint-plugin-css-modules rule set:

npm i -D eslint eslint-config-volue eslint-plugin-css-modules

Add this to your .eslintrc:

{
  "extends": "volue/css-modules"
}

Composition

You can use any combination of these presets.

Install the dependencies:

npm i -D eslint eslint-config-volue eslint-plugin-import @babel/eslint-parser @typescript-eslint/parser @typescript-eslint/eslint-plugin eslint-import-resolver-typescript eslint-plugin-react eslint-plugin-jest eslint-plugin-css-modules

.eslintrc:

{
  "extends": [
    "volue",
    "volue/babel",
    "volue/import",
    "volue/typescript",
    "volue/react",
    "volue/jest",
    "volue/css-modules"
  ],
  "rules": {
    // custom tweaks
  }
}

Patch

Our shareable config uses rules from external plugins such as eslint-plugin-prettier. This patch improves how ESLint loads plugins when working for example in a monorepo, see: https://github.com/eslint/eslint/issues/3458

.eslintrc.js

// Patch ESLint module resolution to find shared configs' plugins
require('eslint-config-volue/patch/modern-module-resolution');

module.exports = {
  extends: ['volue']
};

Readme

Keywords

Package Sidebar

Install

npm i eslint-config-volue

Weekly Downloads

112

Version

15.2.0

License

MIT

Unpacked Size

19.5 kB

Total Files

16

Last publish

Collaborators

  • fima1