1.1.4 • Published 1 year ago

eslint-config-lt-assistant v1.1.4

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

前端项目编码规范(eslint-config-lt-assistant )

前言

为前端开发提供良好的基础编码风格

规则级别

“关闭”或0 -关闭规则

“警告”或1 -将规则作为警告(不会影响退出代码)

“错误”或2 -将规则作为错误打开(退出代码为1 触发)

使用方式

基本引入:

npm add --dev eslint-config-lt-assistant
yarn add --dev eslint-config-lt-assistant

_.eslintrc.js:_

module.exports = {
  extends: ['lt-assistant']
}

vue项目中需要额外引入:

npm add --dev @vue/eslint-config-airbnb eslint-plugin-vue
yarn add --dev @vue/eslint-config-airbnb eslint-plugin-vue

_.eslintrc.js:_

module.exports = {
  extends: [
    'plugin:vue/vue3-essential',
    '@vue/airbnb',
    'lt-assistant',
    'lt-assistant/vue'
  ],
}

typescript 还需要安装依赖

npm install @typescript-eslint/eslint-plugin @typescript-eslint/parser --save-dev
yarn add @typescript-eslint/eslint-plugin @typescript-eslint/parser --save-dev

_.eslintrc.js:_

module.exports = {
  extends: [
    "lt-assistant",
    "lt-assistant/ts"
  ]
}

使用 prettier 的用户需要安装对应的依赖

npm install --save-dev prettier eslint-plugin-prettier
yarn add --dev prettier eslint-plugin-prettier

_.eslintrc.js:_

module.exports = {
  extends: [
  'lt-assistant',
  'lt-assistant/prettier']
}

使用问题

1.ESlint报错:eslint:linter Parsing error: Cannot find module '@babel/core/package.json'

未安装@babel/core导致

  yarn add @babel/core
1.1.4

1 year ago

1.1.3

1 year ago

1.1.2

1 year ago

1.1.1

1 year ago

1.1.0

1 year ago

1.0.5-1

1 year ago

1.0.5-0

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago