Skip to content

Commit

Permalink
Upgrade stylelint to 16
Browse files Browse the repository at this point in the history
  • Loading branch information
louischan-oursky committed Aug 30, 2024
1 parent 16cd64d commit a7d2cac
Show file tree
Hide file tree
Showing 9 changed files with 1,180 additions and 1,934 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## Installation

```sh
npm install --save --save-exact --save-dev @oursky/stylelint-oursky stylelint@^13
npm install --save --save-exact --save-dev @oursky/stylelint-oursky stylelint@^16 caniuse-lite@^1
```

## Usage
Expand All @@ -12,7 +12,7 @@ In your `.stylelintrc`

```json
{
"extends": ["@oursky/stylelint-oursky/config/oursky"]
"extends": ["./node_modules/@oursky/stylelint-oursky/config/oursky.mjs"]
}
```

Expand Down
9 changes: 0 additions & 9 deletions config/oursky.js

This file was deleted.

9 changes: 9 additions & 0 deletions config/oursky.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export default {
extends: ["./stylelint.mjs"],
plugins: ["../src/index.mjs", "stylelint-no-unsupported-browser-features"],
rules: {
"oursky/flex": true,
"plugin/no-unsupported-browser-features": true,
},
defaultSeverity: "error",
};
86 changes: 2 additions & 84 deletions config/stylelint.js → config/stylelint.mjs
Original file line number Diff line number Diff line change
@@ -1,33 +1,18 @@
module.exports = {
export default {
rules: {
// NOTE(SCSS): sass does not compile percentage into number.
"alpha-value-notation": "number",
"annotation-no-unknown": true,
"at-rule-allowed-list": null,
"at-rule-disallowed-list": null,
"at-rule-empty-line-before": null,
"at-rule-name-case": "lower",
"at-rule-name-newline-after": null,
"at-rule-name-space-after": null,
"at-rule-no-unknown": true,
"at-rule-no-vendor-prefix": true,
"at-rule-property-required-list": null,
"at-rule-semicolon-newline-after": null,
"at-rule-semicolon-space-before": null,
"block-closing-brace-empty-line-before": null,
"block-closing-brace-newline-after": null,
"block-closing-brace-newline-before": null,
"block-closing-brace-space-after": null,
"block-closing-brace-space-before": null,
"block-no-empty": null,
"block-opening-brace-newline-after": null,
"block-opening-brace-newline-before": null,
"block-opening-brace-space-after": null,
"block-opening-brace-space-before": null,
// NOTE(SCSS): sass compiles color function into hex.
"color-function-notation": "legacy",
"color-hex-alpha": null,
"color-hex-case": null,
"color-hex-length": null,
"color-named": null,
"color-no-hex": null,
Expand All @@ -41,8 +26,6 @@ module.exports = {
"custom-property-empty-line-before": null,
"custom-property-pattern": null,
"custom-property-no-missing-var-function": true,
"declaration-bang-space-after": null,
"declaration-bang-space-before": null,

"declaration-block-no-duplicate-properties": [
true,
Expand All @@ -52,23 +35,10 @@ module.exports = {
],
"declaration-block-no-duplicate-custom-properties": true,

"declaration-block-no-redundant-longhand-properties": [
true,
{
ignoreShorthands: ["/flex/"],
},
],
"declaration-block-no-redundant-longhand-properties": null,

"declaration-block-no-shorthand-property-overrides": true,
"declaration-block-semicolon-newline-after": null,
"declaration-block-semicolon-newline-before": null,
"declaration-block-semicolon-space-after": null,
"declaration-block-semicolon-space-before": null,
"declaration-block-single-line-max-declarations": null,
"declaration-block-trailing-semicolon": null,
"declaration-colon-newline-after": null,
"declaration-colon-space-after": null,
"declaration-colon-space-before": null,
"declaration-empty-line-before": null,
"declaration-no-important": true,
"declaration-property-max-values": null,
Expand All @@ -90,97 +60,56 @@ module.exports = {
"function-allowed-list": null,
"function-disallowed-list": null,
"function-calc-no-unspaced-operator": true,
"function-comma-newline-after": null,
"function-comma-newline-before": null,
"function-comma-space-after": null,
"function-comma-space-before": null,
"function-linear-gradient-no-nonstandard-direction": true,
"function-max-empty-lines": null,
"function-name-case": "lower",
"function-no-unknown": true,
"function-parentheses-newline-inside": null,
"function-parentheses-space-inside": null,
"function-url-no-scheme-relative": null,
"function-url-quotes": "always",
"function-url-scheme-allowed-list": null,
"function-url-scheme-disallowed-list": null,
"function-whitespace-after": null,
"hue-degree-notation": "angle",
"import-notation": null,
indentation: null,
"keyframe-block-no-duplicate-selectors": true,
"keyframe-declaration-no-important": true,
"keyframe-selector-notation": null,
"keyframes-name-pattern": null,
"length-zero-no-unit": true,
linebreaks: null,
"max-empty-lines": null,
"max-line-length": null,
"max-nesting-depth": null,
"media-feature-colon-space-after": null,
"media-feature-colon-space-before": null,
"media-feature-name-allowed-list": null,
"media-feature-name-disallowed-list": null,
"media-feature-name-case": "lower",
"media-feature-name-no-unknown": true,
"media-feature-name-no-vendor-prefix": true,
"media-feature-name-value-allowed-list": null,
"media-feature-parentheses-space-inside": null,
"media-feature-range-notation": null,
"media-feature-range-operator-space-after": null,
"media-feature-range-operator-space-before": null,
"media-query-list-comma-newline-after": null,
"media-query-list-comma-newline-before": null,
"media-query-list-comma-space-after": null,
"media-query-list-comma-space-before": null,
"no-descending-specificity": true,
"no-duplicate-at-import-rules": true,
"no-duplicate-selectors": true,
"no-empty-first-line": null,
"no-empty-source": null,
"no-eol-whitespace": null,
"no-extra-semicolons": null,
// NOTE(SCSS): sass has line comments
"no-invalid-double-slash-comments": true,
"no-invalid-position-at-import-rule": true,
"no-irregular-whitespace": null,
"no-missing-end-of-source-newline": null,
"no-unknown-animations": true,
"named-grid-areas-no-invalid": true,
"number-leading-zero": "always",
"number-max-precision": 2,
"number-no-trailing-zeros": true,
"property-allowed-list": null,
"property-disallowed-list": null,
"property-case": "lower",
"property-no-unknown": true,
"property-no-vendor-prefix": true,
"rule-empty-line-before": null,
"rule-selector-property-disallowed-list": null,
"selector-attribute-brackets-space-inside": null,
"selector-attribute-name-disallowed-list": null,
"selector-attribute-operator-allowed-list": null,
"selector-attribute-operator-disallowed-list": null,
"selector-attribute-operator-space-after": null,
"selector-attribute-operator-space-before": null,
"selector-attribute-quotes": "always",
"selector-class-pattern": null,
"selector-combinator-allowed-list": null,
"selector-combinator-disallowed-list": null,
"selector-combinator-space-after": null,
"selector-combinator-space-before": null,
"selector-disallowed-list": null,
"selector-descendant-combinator-no-non-space": true,
"selector-id-pattern": null,
"selector-list-comma-newline-after": null,
"selector-list-comma-newline-before": null,
"selector-list-comma-space-after": null,
"selector-list-comma-space-before": null,
"selector-max-attribute": null,
"selector-max-class": null,
"selector-max-combinators": null,
"selector-max-compound-selectors": null,
"selector-max-empty-lines": null,
"selector-max-id": null,
"selector-max-pseudo-class": null,
"selector-max-specificity": null,
Expand All @@ -192,31 +121,20 @@ module.exports = {
"selector-not-notation": null,
"selector-pseudo-class-allowed-list": null,
"selector-pseudo-class-disallowed-list": null,
"selector-pseudo-class-case": "lower",
"selector-pseudo-class-no-unknown": true,
"selector-pseudo-class-parentheses-space-inside": null,
"selector-pseudo-element-allowed-list": null,
"selector-pseudo-element-disallowed-list": null,
"selector-pseudo-element-case": "lower",
"selector-pseudo-element-colon-notation": "double",
"selector-pseudo-element-no-unknown": true,
"selector-type-case": "lower",
"selector-type-no-unknown": true,
"shorthand-property-no-redundant-values": true,
"string-no-newline": true,
"string-quotes": null,
"time-min-milliseconds": null,
"unicode-bom": null,
"unit-allowed-list": null,
"unit-disallowed-list": null,
"unit-case": "lower",
"unit-no-unknown": true,
"value-keyword-case": "lower",
"value-list-comma-newline-after": null,
"value-list-comma-newline-before": null,
"value-list-comma-space-after": null,
"value-list-comma-space-before": null,
"value-list-max-empty-lines": null,
"value-no-vendor-prefix": true,
},
};
Loading

0 comments on commit a7d2cac

Please sign in to comment.