Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: 优化插件代码eslint #27

Merged
merged 3 commits into from
May 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions .eslintignore

This file was deleted.

37 changes: 9 additions & 28 deletions .stylelintrc.js
Original file line number Diff line number Diff line change
@@ -1,50 +1,31 @@
const path = require('path');
module.exports = {
extends: ['stylelint-config-recess-order'],
overrides: [
{
files: ['./src/**/*.scss'],
plugins: ['stylelint-scss', 'stylelint-order'],
rules: {
'scss/at-extend-no-missing-placeholder': true,
'scss/dollar-variable-pattern': '^_?[a-z]+[\\w-]*$',
},
customSyntax: 'postcss-scss',
files: ['src/**/*.scss', 'src/**/*.css'],
},
{
customSyntax: 'postcss-less',
files: ['src/**/*.less'],
},
],
plugins: ['stylelint-scss', 'stylelint-order'],
rules: {
'at-rule-empty-line-before': [
'always',
{
except: ['first-nested', 'blockless-after-blockless'],
ignore: ['after-comment'],
},
],
'at-rule-no-unknown': [
true,
{
ignoreAtRules: ['/.*/'],
},
],
'at-rule-no-vendor-prefix': true,
'block-opening-brace-space-before': 'always',
// 颜色值要小写
'color-hex-case': 'lower',
// 颜色值能短则短
'color-hex-length': 'short',
'comment-empty-line-before': ['always', { except: ['first-nested'] }],
'declaration-block-single-line-max-declarations': 1,
'declaration-colon-space-after': 'always',
'declaration-colon-space-before': 'never',
// 不能用important
'declaration-no-important': true,
// Base rules
indentation: 2,
// Sass rules
'max-nesting-depth': 10,
// 不要使用已被 autoprefixer 支持的浏览器前缀
'media-feature-name-no-vendor-prefix': true,

'number-leading-zero': 'never',
'order/order': ['declarations', { type: 'at-rule' }, { hasBlock: true, type: 'at-rule' }, 'rules'],
'property-no-vendor-prefix': true,
// 去掉多个import、extends、父子声明之间的空行 --开始
Expand All @@ -55,10 +36,10 @@ module.exports = {
ignore: ['after-comment'],
},
],
'selector-list-comma-newline-after': 'always',
'scss/at-extend-no-missing-placeholder': true,
'scss/dollar-variable-pattern': '^_?[a-z]+[\\w-]*$',
'selector-max-id': 3,
'selector-no-vendor-prefix': true,
'string-quotes': 'single',
'value-no-vendor-prefix': true,
},
};
Loading
Loading