@tomjs/eslint

3.3.0 • Public • Published

@tomjs/eslint

npm node-current (scoped) NPM

English | 中文

Front-end project eslint js/ts/vue/react code style specification configuration, node>=16 is recommended.

Usage

  • Install dependencies
pnpm add -D eslint prettier @tomjs/eslint
  • Modify the .eslintrc.{js,cjs} configuration as needed, such as
module.exports = {
  root: true,
  env: {
    es6: true,
  },
  extends: [require.resolve('@tomjs/eslint')],
};

default

Basic configuration, including eslint basic configuration, prettier, import, sort, etc.

Change setting

Modify the .eslintrc.{js,cjs} configuration, such as

module.exports = {
  root: true,
  env: {
    es6: true,
  },
  extends: [require.resolve('@tomjs/eslint')],
};

Make configuration

pnpm add ---save-peer eslint prettier
pnpm add eslint-config-prettier eslint-plugin-import eslint-plugin-prettier eslint-plugin-simple-import-sort

typescript

Basic configuration, inherit default, add typescript support

Change setting

Modify the .eslintrc.{js,cjs} configuration, such as

module.exports = {
  root: true,
  env: {
    es6: true,
  },
  extends: [require.resolve('@tomjs/eslint/typescript')],
};

Make configuration

pnpm add ---save-peer typescript
pnpm add @typescript-eslint/eslint-plugin @typescript-eslint/parser eslint-import-resolver-typescript

vue

vue project configuration, inherit default

Change setting

Modify the .eslintrc.{js,cjs} configuration, such as

module.exports = {
  root: true,
  env: {
    browser: true,
    es6: true,
  },
  extends: [require.resolve('@tomjs/eslint/vue')],
};

Make configuration

pnpm add vue-eslint-parser eslint-plugin-vue

vue/typescript

vue project configuration, inherits typescript and vue

Change setting

Modify the .eslintrc.{js,cjs} configuration, such as

module.exports = {
  root: true,
  env: {
    browser: true,
    es6: true,
  },
  extends: [require.resolve('@tomjs/eslint/vue/typescript')],
};

react

react project configuration, inherit default

Change setting

Modify the .eslintrc.{js,cjs} configuration, such as

module.exports = {
  root: true,
  env: {
    browser: true,
    es6: true,
  },
  extends: [require.resolve('@tomjs/eslint/react')],
};

Make configuration

pnpm add eslint-plugin-react eslint-plugin-react-hooks eslint-plugin-react-refresh

react/typescript

React project configuration, inherits typescript and react

Change setting

Modify the .eslintrc.{js,cjs} configuration, such as

module.exports = {
  root: true,
  env: {
    browser: true,
    es6: true,
  },
  extends: [require.resolve('@tomjs/eslint/react/typescript')],
};

Package Sidebar

Install

npm i @tomjs/eslint

Weekly Downloads

4

Version

3.3.0

License

MIT

Unpacked Size

25.1 kB

Total Files

24

Last publish

Collaborators

  • tomgao365