From 7c517543654e7ea91f63113db11acffff6bf5a4a Mon Sep 17 00:00:00 2001 From: Shannon Moeller Date: Mon, 11 Oct 2021 15:52:33 +0000 Subject: [PATCH 1/4] update to github workflows, update formatting --- .editorconfig | 6 +- .github/workflows/main.yml | 34 +++++++++ .travis.yml | 9 --- package-lock.json | 26 +------ package.json | 25 ++----- src/index.js | 140 +++++++++++++------------------------ 6 files changed, 90 insertions(+), 150 deletions(-) create mode 100644 .github/workflows/main.yml delete mode 100644 .travis.yml diff --git a/.editorconfig b/.editorconfig index ac3c2b4..57636a6 100644 --- a/.editorconfig +++ b/.editorconfig @@ -8,11 +8,7 @@ indent_style = tab insert_final_newline = true trim_trailing_whitespace = true -[.*rc] -indent_size = 2 -indent_style = space - -[*.json] +[{.*rc,*.json,*.yml}] indent_size = 2 indent_style = space diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..0cef53f --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,34 @@ +name: CI +on: + - push + - pull_request +jobs: + test: + name: Node.js ${{ matrix.node-version }} on ${{ matrix.os }} with stylelint ${{ matrix.stylelint-version }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + node-version: + - 16 + - 14 + - 12 + - 10 + os: + - ubuntu-latest + - macos-latest + - windows-latest + stylelint-version: + - 13 + - 12 + - 11 + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + node-version: ${{ matrix.node-version }} + - run: npm install + - env: + STYLELINT_VERSION: ${{ matrix.stylelint-version}} + run: npm install --no-save "stylelint@${STYLELINT_VERSION}" + - run: npm test diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index b39938e..0000000 --- a/.travis.yml +++ /dev/null @@ -1,9 +0,0 @@ -sudo: false -language: node_js -node_js: - - 'node' - - '14' - - '12' - - '10' -before_script: - - npm install --no-save stylelint diff --git a/package-lock.json b/package-lock.json index 23e8718..0774695 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,29 +1,5 @@ { "name": "stylelint-config-prettier", "version": "8.0.2", - "lockfileVersion": 1, - "requires": true, - "dependencies": { - "eslint-config-prettier": { - "version": "6.11.0", - "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-6.11.0.tgz", - "integrity": "sha512-oB8cpLWSAjOVFEJhhyMZh6NOEOtBVziaqdDQ86+qhDHFbZXoRTM7pNSvFRfW/W/L/LrQ38C99J5CGuRBBzBsdA==", - "dev": true, - "requires": { - "get-stdin": "^6.0.0" - } - }, - "get-stdin": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-6.0.0.tgz", - "integrity": "sha512-jp4tHawyV7+fkkSKyvjuLZswblUtz+SQKzSWnBbii16BuZksJlU1wuBYXY75r+duh/llF1ur6oNwi+2ZzjKZ7g==", - "dev": true - }, - "npm-bin-deps": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/npm-bin-deps/-/npm-bin-deps-1.9.0.tgz", - "integrity": "sha512-4G36+YOLqJ2xp0d6wUmzqAqRIMgTHbb0cUaoan8eXSo4ZBqCA0wTA7ysrGlIPje92Kh/jdBkvoTSrEUXqvoLaQ==", - "dev": true - } - } + "lockfileVersion": 1 } diff --git a/package.json b/package.json index bdbaa1c..298e683 100644 --- a/package.json +++ b/package.json @@ -5,8 +5,8 @@ "scripts": { "prepublishOnly": "npm run test", "pretest": "npm run lint && npm run format", - "lint": "npr eslint --fix '{bin,src,test}/*.js'", - "format": "npr prettier --write '{bin,src,test}/*.js'", + "lint": "npx eslint --fix '{bin,src,test}/*.js'", + "format": "npx prettier --write '{bin,src,test}/*.js'", "test": "node test/checker.js" }, "keywords": [ @@ -31,32 +31,19 @@ "peerDependencies": { "stylelint": ">=11.0.0" }, - "devDependencies": { - "npm-bin-deps": "^1.9.0", - "eslint-config-prettier": "^6.11.0" - }, - "binDependencies": { - "eslint": "^7.3.0", - "prettier": "^2.0.5" + "engines": { + "node": ">= 10" }, "eslintConfig": { + "extends": "eslint:recommended", "env": { - "es6": true, "node": true }, - "extends": [ - "eslint:recommended", - "eslint-config-prettier" - ], "parserOptions": { - "ecmaVersion": 2019 + "ecmaVersion": 8 } }, "prettier": { "singleQuote": true - }, - "engines": { - "node": ">= 10", - "npm": ">= 5" } } diff --git a/src/index.js b/src/index.js index e1b620a..f550943 100644 --- a/src/index.js +++ b/src/index.js @@ -4,41 +4,12 @@ module.exports = { rules: { indentation: null, linebreaks: null, - 'max-line-length': null, - - 'function-comma-newline-after': null, - 'function-comma-newline-before': null, - 'function-comma-space-after': null, - 'function-comma-space-before': null, - 'function-max-empty-lines': null, - 'function-parentheses-newline-inside': null, - 'function-parentheses-space-inside': null, - - // prettier doesnt care about this space lets keep it here - // 'function-whitespace-after': 'always'|'never', - - '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, - - // this is fixable but lets keep it - // 'custom-property-empty-line-before': 'never' - - 'declaration-bang-space-after': null, - 'declaration-bang-space-before': null, - 'declaration-colon-newline-after': null, - 'declaration-colon-space-after': null, - 'declaration-colon-space-before': null, - 'declaration-block-semicolon-newline-after': null, - 'declaration-block-semicolon-newline-before': null, - 'declaration-block-semicolon-space-after': null, - 'declaration-block-semicolon-space-before': null, - - // prettier always adds the trailing semicolon - 'declaration-block-trailing-semicolon': null, + 'at-rule-name-case': null, + 'at-rule-name-newline-after': null, + 'at-rule-name-space-after': 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, @@ -48,79 +19,64 @@ module.exports = { 'block-opening-brace-newline-before': null, 'block-opening-brace-space-after': null, 'block-opening-brace-space-before': null, - 'selector-attribute-brackets-space-inside': null, - - 'selector-attribute-operator-space-after': null, - 'selector-attribute-operator-space-before': null, - - 'selector-attribute-quotes': null, - 'selector-combinator-space-after': null, - 'selector-combinator-space-before': null, - 'selector-descendant-combinator-no-non-space': null, - 'selector-pseudo-class-parentheses-space-inside': 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, + 'color-hex-case': null, + 'declaration-bang-space-after': null, + 'declaration-bang-space-before': null, + '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-trailing-semicolon': null, + 'declaration-colon-newline-after': null, + 'declaration-colon-space-after': null, + 'declaration-colon-space-before': null, + 'function-comma-newline-after': null, + 'function-comma-newline-before': null, + 'function-comma-space-after': null, + 'function-comma-space-before': null, + 'function-max-empty-lines': null, + 'function-parentheses-newline-inside': null, + 'function-parentheses-space-inside': null, + 'max-empty-lines': null, + 'max-line-length': null, 'media-feature-colon-space-after': null, 'media-feature-colon-space-before': null, + 'media-feature-name-case': null, 'media-feature-parentheses-space-inside': null, - - // prettier doesnt care about this space - // 'media-feature-range-operator-space-after': 'always', - // 'media-feature-range-operator-space-before': 'always' - '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, - 'at-rule-name-newline-after': null, - 'at-rule-name-space-after': null, - 'at-rule-semicolon-newline-after': null, - 'at-rule-semicolon-space-before': null, - - // prettier doesnt care about this whitespace - // 'comment-whitespace-inside': 'always' - - 'max-empty-lines': null, + 'no-empty-first-line': null, 'no-eol-whitespace': null, + 'no-extra-semicolons': null, 'no-missing-end-of-source-newline': null, - 'no-empty-first-line': null, - 'unicode-bom': null, 'number-leading-zero': null, - - // prettier lowercases hex colors - 'color-hex-case': null, - - // prettier removes trailing zeros 'number-no-trailing-zeros': null, - - // prettier lowercases units - 'unit-case': null, - - // prettier lowercases properties 'property-case': null, - - // prettier lowercases pseudo class selectors + 'selector-attribute-brackets-space-inside': null, + 'selector-attribute-operator-space-after': null, + 'selector-attribute-operator-space-before': null, + 'selector-attribute-quotes': null, + 'selector-combinator-space-after': null, + 'selector-combinator-space-before': null, + 'selector-descendant-combinator-no-non-space': 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-empty-lines': null, 'selector-pseudo-class-case': null, - - // prettier lowercases pseudo element selectors + 'selector-pseudo-class-parentheses-space-inside': null, 'selector-pseudo-element-case': null, - - // prettier removes empty lines in selector blocks - 'selector-max-empty-lines': null, - - // prettier lowercases media feature names - 'media-feature-name-case': null, - - // prettier lowercases @ rule names - 'at-rule-name-case': null, - - // prettier removes extra semicolons - 'no-extra-semicolons': null, - - // prettier has its own quotes rule 'string-quotes': null, + 'unicode-bom': null, + 'unit-case': null, + '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, 'scss/at-else-closing-brace-newline-after': null, 'scss/at-else-closing-brace-space-after': null, From 2d82bfcf4bb8d43e264ef49adb21ef24b8224e89 Mon Sep 17 00:00:00 2001 From: Shannon Moeller Date: Mon, 11 Oct 2021 16:02:45 +0000 Subject: [PATCH 2/4] fix cross-platform issues --- .github/workflows/main.yml | 1 - package.json | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0cef53f..857cb7d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,7 +13,6 @@ jobs: - 16 - 14 - 12 - - 10 os: - ubuntu-latest - macos-latest diff --git a/package.json b/package.json index 298e683..6a80742 100644 --- a/package.json +++ b/package.json @@ -5,8 +5,8 @@ "scripts": { "prepublishOnly": "npm run test", "pretest": "npm run lint && npm run format", - "lint": "npx eslint --fix '{bin,src,test}/*.js'", - "format": "npx prettier --write '{bin,src,test}/*.js'", + "lint": "npx eslint --fix '**/*.js'", + "format": "npx prettier --write '**/*.js'", "test": "node test/checker.js" }, "keywords": [ From e42d13d4c954202374a8e706ebe743cde4cb8e3d Mon Sep 17 00:00:00 2001 From: Shannon Moeller Date: Mon, 11 Oct 2021 16:09:02 +0000 Subject: [PATCH 3/4] use double quotes for windows compatibility --- package.json | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 6a80742..b7528fc 100644 --- a/package.json +++ b/package.json @@ -4,9 +4,8 @@ "description": "Turns off all rules that are unnecessary or might conflict with Prettier.", "scripts": { "prepublishOnly": "npm run test", - "pretest": "npm run lint && npm run format", - "lint": "npx eslint --fix '**/*.js'", - "format": "npx prettier --write '**/*.js'", + "pretest": "npm run lint", + "lint": "npx eslint --fix \"**/*.js\" && npx prettier --write \"**/*.js\"", "test": "node test/checker.js" }, "keywords": [ From e9c3a497a03c53ace18ea342f1312a2677302083 Mon Sep 17 00:00:00 2001 From: Shannon Moeller Date: Mon, 11 Oct 2021 16:11:07 +0000 Subject: [PATCH 4/4] fix node engine value --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b7528fc..31ed4db 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "stylelint": ">=11.0.0" }, "engines": { - "node": ">= 10" + "node": ">= 12" }, "eslintConfig": { "extends": "eslint:recommended",