CSS基本知识点 我们在学习HTML之后,前端三件套第二件便是CSS,但CSS内容较多,我们分几部分讲解: (如果没有学习HTML,请参考之前文章:HTML知识点概括——一篇文章带你完全掌握HTML>
顺晟科技
2021-08-31 10:40:16
199
①
npm install eslint -D
②./node_modules/.bin/eslint --init
③ 采用airbnb-base标准
npx install-peerdeps --dev eslint-config-airbnb-base
④ 增加package.json中script指令
"lint": "eslint --fix --ext .js,.vue src"
⑤ 修改.eslint.js中的部分规则和airbnb-base依赖,及解决一些airbnb中不合理的报错规则如:airbnb-base报import/no-unresolved
module.exports = {
env: {
es2021: true,
node: true,
},
extends: ['eslint:recommended', 'plugin:vue/essential', 'airbnb-base'],
parserOptions: {
ecmaVersion: 12,
sourceType: 'module',
},
plugins: ['vue'],
rules: {
'max-len': ['error', { code: 150 }],
'import/no-unresolved': 'off', // 取消自动解析路径,以此开启alias的别名路径设置
'arrow-parens': ['error', 'as-needed'], // 箭头函数的参数可以不使用圆括号
'comma-dangle': ['error', 'never'], // 不允许末尾逗号
'no-underscore-dangle': 'off', //允许标识符中有下划线,从而支持vue中插件的使用
'linebreak-style': 'off', // 取消换行符\n或\r\n的验证
'no-param-reassign': 'off', // 允许对函数参数进行再赋值
'consistent-return': 'off', // 关闭函数中return的检测
},
settings: {
'import/resolver': {
node: {
extensions: ['.js', '.jsx', '.vue'],
},
},
},
};
15
2022-09
13
2022-09
13
2022-09
13
2022-09
01
2021-10
31
2021-08