Skip to content

jiandandkl/eslint-sensorsdata

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

eslint-sensorsdata

神策数据前端eslint规则

基于airbnb配置的个性化 ESLint 规则

使用

在项目中添加.eslintrc.js文件,添加extends

module.exports = {
  extends: ['@sc/eslin-config-sensorsdata']
};

react项目:

module.exports = {
  extends: ['@sc/eslin-config-sensorsdata-react']
}

ts:

module.exports = {
  extends: ['@sc/eslin-config-sensorsdata-typescript']
};

常见问题

在 VSCode 中,默认 ESLint 并不能识别 .vue、.ts 或 .tsx 文件,需要在「文件 => 首选项 => 设置」里做如下配置:

{
  "eslint.validate": [
    "javascript",
    "javascriptreact",
    "vue",
    "typescript",
    "typescriptreact"
  ]
}

VSCode 中的 autoFixOnSave 没有效果:

{
  "eslint.autoFixOnSave": true,
  "eslint.validate": [
    "javascript",
    "javascriptreact",
    {
      "language": "vue",
      "autoFix": true
    },
    {
      "language": "typescript",
      "autoFix": true
    },
    {
      "language": "typescriptreact",
      "autoFix": true
    }
  ]
}

About

神策数据前端eslint规则

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published