Bug 31528: Replace scss-lint configuration with one for stylelint
This patch removes the SCSS linting configuration .scss-lint.yml which
was intended to be used with a now-obsolete tool, scss-lint.
It is replaced with .stylelintrc.json, for use with stylelint. I've
tried to keep the linting rules the same as before.
To test, run 'yarn install' to install the new dependencies.
You can test stylelint from the command line like so:
npx stylelint koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss
It should output a list of problems with the file:
koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss
30:27 ✖ Expected "#e6f0f2" to be "#E6F0F2" color-hex-case
81:31 ✖ Expected single space after "(" function-parentheses-space-inside
...etc.
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
parent
44537c58d1
commit
b90c13912d
245
.scss-lint.yml
245
.scss-lint.yml
|
|
@ -1,245 +0,0 @@
|
||||||
# Default application configuration that all configurations inherit from.
|
|
||||||
|
|
||||||
scss_files: "**/*.scss"
|
|
||||||
plugin_directories: ['.scss-linters']
|
|
||||||
|
|
||||||
# List of gem names to load custom linters from (make sure they are already
|
|
||||||
# installed)
|
|
||||||
plugin_gems: []
|
|
||||||
|
|
||||||
# Default severity of all linters.
|
|
||||||
severity: warning
|
|
||||||
|
|
||||||
linters:
|
|
||||||
BangFormat:
|
|
||||||
enabled: true
|
|
||||||
space_before_bang: true
|
|
||||||
space_after_bang: false
|
|
||||||
|
|
||||||
BemDepth:
|
|
||||||
enabled: false
|
|
||||||
max_elements: 1
|
|
||||||
|
|
||||||
BorderZero:
|
|
||||||
enabled: true
|
|
||||||
convention: zero # or `none`
|
|
||||||
|
|
||||||
ChainedClasses:
|
|
||||||
enabled: false
|
|
||||||
|
|
||||||
ColorKeyword:
|
|
||||||
enabled: true
|
|
||||||
|
|
||||||
ColorVariable:
|
|
||||||
enabled: false
|
|
||||||
|
|
||||||
Comment:
|
|
||||||
enabled: true
|
|
||||||
style: silent
|
|
||||||
|
|
||||||
DebugStatement:
|
|
||||||
enabled: true
|
|
||||||
|
|
||||||
DeclarationOrder:
|
|
||||||
enabled: true
|
|
||||||
|
|
||||||
DisableLinterReason:
|
|
||||||
enabled: false
|
|
||||||
|
|
||||||
DuplicateProperty:
|
|
||||||
enabled: true
|
|
||||||
|
|
||||||
ElsePlacement:
|
|
||||||
enabled: true
|
|
||||||
style: same_line # or 'new_line'
|
|
||||||
|
|
||||||
EmptyLineBetweenBlocks:
|
|
||||||
enabled: true
|
|
||||||
ignore_single_line_blocks: true
|
|
||||||
|
|
||||||
EmptyRule:
|
|
||||||
enabled: true
|
|
||||||
|
|
||||||
ExtendDirective:
|
|
||||||
enabled: false
|
|
||||||
|
|
||||||
FinalNewline:
|
|
||||||
enabled: true
|
|
||||||
present: true
|
|
||||||
|
|
||||||
HexLength:
|
|
||||||
enabled: false
|
|
||||||
style: short # or 'long'
|
|
||||||
|
|
||||||
HexNotation:
|
|
||||||
enabled: true
|
|
||||||
style: uppercase # or 'lowercase'
|
|
||||||
|
|
||||||
HexValidation:
|
|
||||||
enabled: true
|
|
||||||
|
|
||||||
IdSelector:
|
|
||||||
enabled: false
|
|
||||||
|
|
||||||
ImportantRule:
|
|
||||||
enabled: true
|
|
||||||
|
|
||||||
ImportPath:
|
|
||||||
enabled: true
|
|
||||||
leading_underscore: false
|
|
||||||
filename_extension: false
|
|
||||||
|
|
||||||
Indentation:
|
|
||||||
enabled: true
|
|
||||||
allow_non_nested_indentation: false
|
|
||||||
character: space # or 'tab'
|
|
||||||
width: 4
|
|
||||||
|
|
||||||
LeadingZero:
|
|
||||||
enabled: true
|
|
||||||
style: exclude_zero # or 'include_zero'
|
|
||||||
|
|
||||||
MergeableSelector:
|
|
||||||
enabled: true
|
|
||||||
force_nesting: true
|
|
||||||
|
|
||||||
NameFormat:
|
|
||||||
enabled: true
|
|
||||||
allow_leading_underscore: true
|
|
||||||
convention: hyphenated_lowercase # or 'camel_case', or 'snake_case', or a regex pattern
|
|
||||||
|
|
||||||
NestingDepth:
|
|
||||||
enabled: false
|
|
||||||
max_depth: 4
|
|
||||||
ignore_parent_selectors: false
|
|
||||||
|
|
||||||
PlaceholderInExtend:
|
|
||||||
enabled: true
|
|
||||||
|
|
||||||
PrivateNamingConvention:
|
|
||||||
enabled: false
|
|
||||||
prefix: _
|
|
||||||
|
|
||||||
PropertyCount:
|
|
||||||
enabled: false
|
|
||||||
include_nested: false
|
|
||||||
max_properties: 10
|
|
||||||
|
|
||||||
PropertySortOrder:
|
|
||||||
enabled: true
|
|
||||||
ignore_unspecified: false
|
|
||||||
min_properties: 2
|
|
||||||
separate_groups: false
|
|
||||||
|
|
||||||
PropertySpelling:
|
|
||||||
enabled: true
|
|
||||||
extra_properties: []
|
|
||||||
disabled_properties: []
|
|
||||||
|
|
||||||
PseudoElement:
|
|
||||||
enabled: true
|
|
||||||
|
|
||||||
QualifyingElement:
|
|
||||||
enabled: true
|
|
||||||
allow_element_with_attribute: false
|
|
||||||
allow_element_with_class: false
|
|
||||||
allow_element_with_id: false
|
|
||||||
|
|
||||||
SelectorDepth:
|
|
||||||
enabled: false
|
|
||||||
max_depth: 4
|
|
||||||
|
|
||||||
SelectorFormat:
|
|
||||||
enabled: false
|
|
||||||
convention: hyphenated_lowercase # or 'classic_BEM', or 'hyphenated_BEM', or 'snake_case', or 'camel_case', or a regex pattern
|
|
||||||
|
|
||||||
Shorthand:
|
|
||||||
enabled: true
|
|
||||||
allowed_shorthands: [1, 2, 3, 4]
|
|
||||||
|
|
||||||
SingleLinePerProperty:
|
|
||||||
enabled: true
|
|
||||||
allow_single_line_rule_sets: false
|
|
||||||
|
|
||||||
SingleLinePerSelector:
|
|
||||||
enabled: true
|
|
||||||
|
|
||||||
SpaceAfterComma:
|
|
||||||
enabled: true
|
|
||||||
style: one_space # or 'no_space', or 'at_least_one_space'
|
|
||||||
|
|
||||||
SpaceAfterComment:
|
|
||||||
enabled: false
|
|
||||||
style: one_space # or 'no_space', or 'at_least_one_space'
|
|
||||||
allow_empty_comments: true
|
|
||||||
|
|
||||||
SpaceAfterPropertyColon:
|
|
||||||
enabled: true
|
|
||||||
style: one_space # or 'no_space', or 'at_least_one_space', or 'aligned'
|
|
||||||
|
|
||||||
SpaceAfterPropertyName:
|
|
||||||
enabled: true
|
|
||||||
|
|
||||||
SpaceAfterVariableColon:
|
|
||||||
enabled: false
|
|
||||||
style: one_space # or 'no_space', 'at_least_one_space' or 'one_space_or_newline'
|
|
||||||
|
|
||||||
SpaceAfterVariableName:
|
|
||||||
enabled: true
|
|
||||||
|
|
||||||
SpaceAroundOperator:
|
|
||||||
enabled: true
|
|
||||||
style: one_space # or 'at_least_one_space', or 'no_space'
|
|
||||||
|
|
||||||
SpaceBeforeBrace:
|
|
||||||
enabled: true
|
|
||||||
style: space # or 'new_line'
|
|
||||||
allow_single_line_padding: false
|
|
||||||
|
|
||||||
SpaceBetweenParens:
|
|
||||||
enabled: true
|
|
||||||
spaces: 0
|
|
||||||
|
|
||||||
StringQuotes:
|
|
||||||
enabled: true
|
|
||||||
style: double_quotes # or single_quotes
|
|
||||||
|
|
||||||
TrailingSemicolon:
|
|
||||||
enabled: true
|
|
||||||
|
|
||||||
TrailingWhitespace:
|
|
||||||
enabled: true
|
|
||||||
|
|
||||||
TrailingZero:
|
|
||||||
enabled: false
|
|
||||||
|
|
||||||
TransitionAll:
|
|
||||||
enabled: false
|
|
||||||
|
|
||||||
UnnecessaryMantissa:
|
|
||||||
enabled: true
|
|
||||||
|
|
||||||
UnnecessaryParentReference:
|
|
||||||
enabled: true
|
|
||||||
|
|
||||||
UrlFormat:
|
|
||||||
enabled: true
|
|
||||||
|
|
||||||
UrlQuotes:
|
|
||||||
enabled: true
|
|
||||||
|
|
||||||
VariableForProperty:
|
|
||||||
enabled: false
|
|
||||||
properties: []
|
|
||||||
|
|
||||||
VendorPrefix:
|
|
||||||
enabled: true
|
|
||||||
identifier_list: base
|
|
||||||
additional_identifiers: []
|
|
||||||
excluded_identifiers: []
|
|
||||||
|
|
||||||
ZeroUnit:
|
|
||||||
enabled: true
|
|
||||||
|
|
||||||
Compass::*:
|
|
||||||
enabled: false
|
|
||||||
|
|
@ -0,0 +1,30 @@
|
||||||
|
{
|
||||||
|
"extends": "stylelint-config-standard-scss",
|
||||||
|
"plugins": [
|
||||||
|
"stylelint-order"
|
||||||
|
],
|
||||||
|
"rules": {
|
||||||
|
"alpha-value-notation": null,
|
||||||
|
"color-hex-case": "upper",
|
||||||
|
"color-hex-length": null,
|
||||||
|
"color-named": "never",
|
||||||
|
"declaration-colon-space-after": "always",
|
||||||
|
"declaration-no-important": true,
|
||||||
|
"function-parentheses-space-inside": "always",
|
||||||
|
"indentation": 4,
|
||||||
|
"keyframes-name-pattern": null,
|
||||||
|
"max-line-length": null,
|
||||||
|
"media-feature-parentheses-space-inside": "always",
|
||||||
|
"no-descending-specificity": null,
|
||||||
|
"no-duplicate-selectors": true,
|
||||||
|
"number-leading-zero": "never",
|
||||||
|
"order/properties-alphabetical-order": true,
|
||||||
|
"selector-class-pattern": null,
|
||||||
|
"selector-id-pattern": null,
|
||||||
|
"selector-no-qualifying-type": null,
|
||||||
|
"selector-pseudo-class-parentheses-space-inside": "always",
|
||||||
|
"selector-pseudo-element-colon-notation": "double",
|
||||||
|
"shorthand-property-no-redundant-values": null,
|
||||||
|
"font-family-no-missing-generic-family-keyword": null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -37,5 +37,12 @@
|
||||||
"js-yaml": "^3.13.1"
|
"js-yaml": "^3.13.1"
|
||||||
},
|
},
|
||||||
"author": "",
|
"author": "",
|
||||||
"license": "GPL-3.0"
|
"license": "GPL-3.0",
|
||||||
|
"devDependencies": {
|
||||||
|
"postcss-selector-parser": "^6.0.10",
|
||||||
|
"postcss": "^8.4.14",
|
||||||
|
"stylelint-config-standard-scss": "^5.0.0",
|
||||||
|
"stylelint-order": "^5.0.0",
|
||||||
|
"stylelint": "^14.9.1"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue