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

Prepare 14.0.0 #143

Merged
merged 5 commits into from Sep 14, 2021
Merged

Prepare 14.0.0 #143

merged 5 commits into from Sep 14, 2021

Conversation

ybiquitous
Copy link
Member

@ybiquitous ybiquitous commented Sep 14, 2021

Which issue, if any, is this issue related to?

None.

Is there anything in the PR that needs further explanation?

13.1.1...HEAD

@ybiquitous ybiquitous marked this pull request as ready for review September 14, 2021 18:00
@ybiquitous
Copy link
Member Author

We can confirm this prepare-14.0.0 branch works on the stylelint/stylelint repository.

  1. Run npm i 'github:stylelint/eslint-config-stylelint#prepare-14.0.0'
  2. Run npm run lint:js
✖ 2995 problems (2991 errors, 4 warnings)
  22 errors and 3 warnings potentially fixable with the `--fix` option.

@jeddy3
Copy link
Member

jeddy3 commented Sep 14, 2021

2995 problems

Is that mainly because of sourceType: "module", and is the plan to override this locally in the stylelint package.json until we do the migration to ESM?

@ybiquitous
Copy link
Member Author

Yes! Most problems are about CommonJS:

  • 'require' is not defined.
  • '__dirname' is not defined.
  • 'module' is not defined.

Copy link
Member

@jeddy3 jeddy3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, then.

Let's override the setting locally until we do the migrations to ESM.

@ybiquitous
Copy link
Member Author

Yes. We can avoid the problems of CommonJS like this:

     "globals": {
-      "testRule": true
+      "testRule": true,
+      "module": true,
+      "require": true,
+      "__dirname": true
     },

In the config above, it will be 40 problems (due to regexp/* rules).

$ npm run lint:js

> stylelint@13.13.1 lint:js
> eslint . --cache --max-warnings=0


/Users/koba/git/stylelint/stylelint/lib/__tests__/standalone-syntax.test.js
  23:39  error  Capturing group number 1 is defined but never used  regexp/no-unused-capturing-group

/Users/koba/git/stylelint/stylelint/lib/rules/color-hex-alpha/index.js
  16:16  error  Capturing group number 1 is defined but never used  regexp/no-unused-capturing-group

/Users/koba/git/stylelint/stylelint/lib/rules/declaration-colon-newline-after/index.js
  67:14  error  '\r?' can be removed because it is already included by '\s*'  regexp/optimal-quantifier-concatenation

/Users/koba/git/stylelint/stylelint/lib/rules/font-family-name-quotes/index.js
  55:12  error  Capturing group number 1 is defined but never used                  regexp/no-unused-capturing-group
  55:40  error  Unexpected character class ranges '[_a-zA-Z0-9]'. Use '\w' instead  regexp/prefer-w

/Users/koba/git/stylelint/stylelint/lib/rules/function-calc-no-unspaced-operator/index.js
  244:38  error  Unescaped source character '{'  regexp/strict
  244:42  error  Unescaped source character '}'  regexp/strict

/Users/koba/git/stylelint/stylelint/lib/rules/indentation/index.js
  306:36  error  Unescaped source character '{'                      regexp/strict
  312:44  error  Unescaped source character '}'                      regexp/strict
  610:17  error  Capturing group number 1 is defined but never used  regexp/no-unused-capturing-group
  611:12  error  'RegExp.$1' static property is forbidden            regexp/no-legacy-features

/Users/koba/git/stylelint/stylelint/lib/rules/max-empty-lines/index.js
  164:12  error    Capturing group number 1 is defined but never used                                          regexp/no-unused-capturing-group
  164:20  warning  The 'g' flag is unnecessary because the regex is used only once in 'RegExp.prototype.test'  regexp/no-useless-flag

/Users/koba/git/stylelint/stylelint/lib/rules/media-query-list-comma-newline-after/index.js
  68:19  error  '\r?' can be removed because it is already included by '\s*'  regexp/optimal-quantifier-concatenation

/Users/koba/git/stylelint/stylelint/lib/rules/mediaQueryListCommaWhitespaceChecker.js
  32:40  error  Capturing group number 2 is defined but never used  regexp/no-unused-capturing-group

/Users/koba/git/stylelint/stylelint/lib/rules/number-no-trailing-zeros/index.js
  55:23  error  The quantifier '\d*?' can exchange characters with '0+'. Using any string accepted by /0+/, this can be exploited to cause at least polynomial backtracking  regexp/no-super-linear-backtracking

/Users/koba/git/stylelint/stylelint/lib/rules/selector-disallowed-list/__tests__/index.js
   7:33  error  Unescaped source character ']'                                                                                                                                                                        regexp/strict
  63:17  error  The quantifier '.*' can exchange characters with '.*'. Using any string accepted by />+/, this can be exploited to cause at least polynomial backtracking. This might cause exponential backtracking  regexp/no-super-linear-backtracking

/Users/koba/git/stylelint/stylelint/lib/rules/string-no-newline/index.js
  15:20  error  Capturing group number 1 is defined but never used  regexp/no-unused-capturing-group
  65:7   error  'RegExp.leftContext' static property is forbidden   regexp/no-legacy-features
  99:6   error  'RegExp.leftContext' static property is forbidden   regexp/no-legacy-features

/Users/koba/git/stylelint/stylelint/lib/rules/unit-disallowed-list/index.js
  28:11  error    Capturing group number 2 is defined but never used                                       regexp/no-unused-capturing-group
  28:21  warning  The 'i' flag is unnecessary because the pattern only contains case-invariant characters  regexp/no-useless-flag

/Users/koba/git/stylelint/stylelint/lib/utils/hasLessInterpolation.js
  10:11  error  Unescaped source character '{'  regexp/strict
  10:15  error  Unescaped source character '}'  regexp/strict

/Users/koba/git/stylelint/stylelint/lib/utils/hasScssInterpolation.js
  9:11  error  Unescaped source character '{'  regexp/strict
  9:15  error  Unescaped source character '}'  regexp/strict

/Users/koba/git/stylelint/stylelint/lib/utils/hasTplInterpolation.js
  10:10  error  Unescaped source character '{'  regexp/strict
  10:14  error  Unescaped source character '}'  regexp/strict

/Users/koba/git/stylelint/stylelint/lib/utils/isKeyframeSelector.js
  17:11  error  The quantifier '\d+' can exchange characters with '\d*'. Using any string accepted by /\d+/, this can be exploited to cause at least polynomial backtracking  regexp/no-super-linear-backtracking
  17:21  error  The quantifier '\d*' can exchange characters with '\d+'. Using any string accepted by /\d+/, this can be exploited to cause at least polynomial backtracking  regexp/no-super-linear-backtracking

/Users/koba/git/stylelint/stylelint/lib/utils/isStandardSyntaxMediaFeatureName.js
  11:8   error    Unescaped source character '{'                                                       regexp/strict
  11:12  error    Unescaped source character '}'                                                       regexp/strict
  11:16  warning  The quantifier can be removed because the quantifier is lazy and has a minimum of 1  regexp/no-lazy-ends

/Users/koba/git/stylelint/stylelint/lib/utils/isStandardSyntaxSelector.js
  28:14  error    Capturing group number 1 is defined but never used                                       regexp/no-unused-capturing-group
  33:24  warning  The 'i' flag is unnecessary because the pattern only contains case-invariant characters  regexp/no-useless-flag

/Users/koba/git/stylelint/stylelint/lib/utils/isStandardSyntaxUrl.js
  43:35  error  Unexpected obscure character range. The characters of '+-/' (U+002b - U+002f) are not obvious  regexp/no-obscure-range
  43:41  error  '/' (U+002f) is already included in '+-/' (U+002b - U+002f)                                    regexp/no-dupe-characters-character-class

/Users/koba/git/stylelint/stylelint/lib/utils/removeEmptyLinesAfter.js
  12:69  error  '\r?' can be removed because it is already included by '\s*'  regexp/optimal-quantifier-concatenation

/Users/koba/git/stylelint/stylelint/lib/utils/removeEmptyLinesBefore.js
  12:72  error  '\r?' can be removed because it is already included by '\s*'  regexp/optimal-quantifier-concatenation

✖ 40 problems (36 errors, 4 warnings)
  22 errors and 3 warnings potentially fixable with the `--fix` option.

@ybiquitous ybiquitous merged commit 19f9a2f into master Sep 14, 2021
@ybiquitous ybiquitous deleted the prepare-14.0.0 branch September 14, 2021 18:28
@ybiquitous
Copy link
Member Author

14.0.0 released! 🎉

https://github.com/stylelint/eslint-config-stylelint/releases/tag/14.0.0
https://www.npmjs.com/package/eslint-config-stylelint

@jeddy3 Thank you for your help! 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants