eslint-config-selling

ESLint config base version

Usage no npm install needed!

<script type="module">
  import eslintConfigSelling from 'https://cdn.skypack.dev/eslint-config-selling';
</script>

README

ESLint规范

是商羚前端ESLint规范,目前支持taro|vue|react

安装

npm install @jd/eslint-config-selling -D
# OR
yarn add @jd/eslint-config-selling --dev

使用

在你的工程根目录下创建一个.eslintrc.js配置文件

配置如下:

  • taro
module.exports = {
  extends: ['@jd/selling/taro'],
};
  • vue
module.exports = {
  extends: ['@jd/selling/vue'],
};
  • react
module.exports = {
  extends: ['@jd/selling/react'],
};

:::caution 如果项目之前安装过ESLint相关的包,建议卸载,避免引入不必要的包。如eslinteslint-plugin-vue@babel/eslint-parser@typescript-eslint/eslint-plugin@typescript-eslint/parser@vue/eslint-config-standard@vue/eslint-config-typescripteslint-config-react-appeslint-plugin-import等,直接在package.json搜索eslint,相关的包全部卸载 :::

规范

ESLint规范