diff --git a/package-lock.json b/package-lock.json index 34d471ee..4f12e710 100644 --- a/package-lock.json +++ b/package-lock.json @@ -54,7 +54,7 @@ "postcss-sass": "^0.5.0", "postcss-scss": "^4.0.2", "prettier": "^2.5.0", - "stylelint": "^14.1.0", + "stylelint": "git+https://git@github.com/stylelint/stylelint.git#warning-ranges", "stylelint-processor-glamorous": "^0.3.0", "stylelint-processor-styled-components": "^1.10.0", "ts-jest": "^27.0.7", @@ -68,6 +68,103 @@ "vscode": ">=1.56.0" } }, + "../stylelint": { + "version": "14.1.0", + "extraneous": true, + "license": "MIT", + "dependencies": { + "@flatten-js/interval-tree": "^1.0.15", + "balanced-match": "^2.0.0", + "colord": "^2.9.1", + "cosmiconfig": "^7.0.1", + "debug": "^4.3.3", + "execall": "^2.0.0", + "fast-glob": "^3.2.7", + "fastest-levenshtein": "^1.0.12", + "file-entry-cache": "^6.0.1", + "get-stdin": "^8.0.0", + "global-modules": "^2.0.0", + "globby": "^11.0.4", + "globjoin": "^0.1.4", + "html-tags": "^3.1.0", + "ignore": "^5.1.9", + "import-lazy": "^4.0.0", + "imurmurhash": "^0.1.4", + "is-plain-object": "^5.0.0", + "known-css-properties": "^0.23.0", + "mathml-tag-names": "^2.1.3", + "meow": "^9.0.0", + "micromatch": "^4.0.4", + "normalize-path": "^3.0.0", + "normalize-selector": "^0.2.0", + "picocolors": "^1.0.0", + "postcss": "^8.4.0", + "postcss-media-query-parser": "^0.2.3", + "postcss-resolve-nested-selector": "^0.1.1", + "postcss-safe-parser": "^6.0.0", + "postcss-selector-parser": "^6.0.6", + "postcss-value-parser": "^4.2.0", + "resolve-from": "^5.0.0", + "specificity": "^0.4.1", + "string-width": "^4.2.3", + "strip-ansi": "^6.0.1", + "style-search": "^0.1.0", + "svg-tags": "^1.0.0", + "table": "^6.7.5", + "v8-compile-cache": "^2.3.0", + "write-file-atomic": "^3.0.3" + }, + "bin": { + "stylelint": "bin/stylelint.js" + }, + "devDependencies": { + "@stylelint/prettier-config": "^2.0.0", + "@stylelint/remark-preset": "^3.0.0", + "@types/balanced-match": "^1.0.1", + "@types/debug": "^4.1.7", + "@types/file-entry-cache": "^5.0.2", + "@types/global-modules": "^2.0.0", + "@types/globjoin": "^0.1.0", + "@types/imurmurhash": "^0.1.1", + "@types/micromatch": "^4.0.2", + "@types/normalize-path": "^3.0.0", + "@types/postcss-less": "^4.0.1", + "@types/postcss-safe-parser": "^5.0.0", + "@types/style-search": "^0.1.3", + "@types/svg-tags": "^1.0.0", + "@types/write-file-atomic": "^3.0.2", + "benchmark": "^2.1.4", + "common-tags": "^1.8.2", + "deepmerge": "^4.2.2", + "eslint": "^8.3.0", + "eslint-config-stylelint": "^15.0.0", + "eslint-plugin-jest": "^25.3.0", + "got": "^11.8.3", + "husky": "^7.0.4", + "jest": "^27.4.3", + "jest-preset-stylelint": "^4.2.0", + "jest-watch-typeahead": "^1.0.0", + "lint-staged": "^12.1.2", + "np": "^7.6.0", + "npm-run-all": "^4.1.5", + "postcss-html": "^1.2.0", + "postcss-import": "^14.0.2", + "postcss-less": "^5.0.0", + "postcss-sass": "^0.5.0", + "postcss-scss": "^4.0.2", + "prettier": "2.5.0", + "remark-cli": "^10.0.1", + "sugarss": "^4.0.1", + "typescript": "^4.5.2" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/stylelint" + } + }, "node_modules/@babel/code-frame": { "version": "7.16.0", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.16.0.tgz", @@ -940,6 +1037,12 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/@flatten-js/interval-tree": { + "version": "1.0.15", + "resolved": "https://registry.npmjs.org/@flatten-js/interval-tree/-/interval-tree-1.0.15.tgz", + "integrity": "sha512-ZdRHGEQIVNIUTIHGiov4PyRlSqBGnWJaS4WHuCR5fguN8E+ZACMoCXMwkUWwLtAnibFF96gtYGo/HP5qLLjioQ==", + "dev": true + }, "node_modules/@humanwhocodes/config-array": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.6.0.tgz", @@ -2910,6 +3013,12 @@ "simple-swizzle": "^0.2.2" } }, + "node_modules/colord": { + "version": "2.9.1", + "resolved": "https://registry.npmjs.org/colord/-/colord-2.9.1.tgz", + "integrity": "sha512-4LBMSt09vR0uLnPVkOUBnmxgoaeN4ewRbx801wY/bXcltXfpR/G46OdWn96XpYmCWuYvO46aBZP4NgX8HpNAcw==", + "dev": true + }, "node_modules/colors": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz", @@ -3283,9 +3392,9 @@ } }, "node_modules/debug": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", - "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", + "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==", "dev": true, "dependencies": { "ms": "2.1.2" @@ -8668,9 +8777,9 @@ } }, "node_modules/postcss-value-parser": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.1.0.tgz", - "integrity": "sha512-97DXOFbQJhk71ne5/Mt6cOu6yxsSfM0QGQyl0L25Gca4yGWEGJaig7l7gbCX623VqTBNGLRLaVUCnNkcedlRSQ==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz", + "integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==", "dev": true }, "node_modules/prelude-ls": { @@ -9669,13 +9778,15 @@ }, "node_modules/stylelint": { "version": "14.1.0", - "resolved": "https://registry.npmjs.org/stylelint/-/stylelint-14.1.0.tgz", - "integrity": "sha512-IedkssuNVA11+v++2PIV2OHOU5A3SfRcXVi56vZVSsMhGrgtwmmit69jeM+08/Tun5DTBe7BuH1Zp1mMLmtKLA==", + "resolved": "git+https://git@github.com/stylelint/stylelint.git#3901a79563ab99577bb826008d2e02fc725586da", "dev": true, + "license": "MIT", "dependencies": { + "@flatten-js/interval-tree": "^1.0.15", "balanced-match": "^2.0.0", + "colord": "^2.9.1", "cosmiconfig": "^7.0.1", - "debug": "^4.3.2", + "debug": "^4.3.3", "execall": "^2.0.0", "fast-glob": "^3.2.7", "fastest-levenshtein": "^1.0.12", @@ -9696,19 +9807,19 @@ "normalize-path": "^3.0.0", "normalize-selector": "^0.2.0", "picocolors": "^1.0.0", - "postcss": "^8.3.11", + "postcss": "^8.4.0", "postcss-media-query-parser": "^0.2.3", "postcss-resolve-nested-selector": "^0.1.1", "postcss-safe-parser": "^6.0.0", "postcss-selector-parser": "^6.0.6", - "postcss-value-parser": "^4.1.0", + "postcss-value-parser": "^4.2.0", "resolve-from": "^5.0.0", "specificity": "^0.4.1", "string-width": "^4.2.3", "strip-ansi": "^6.0.1", "style-search": "^0.1.0", "svg-tags": "^1.0.0", - "table": "^6.7.3", + "table": "^6.7.5", "v8-compile-cache": "^2.3.0", "write-file-atomic": "^3.0.3" }, @@ -9889,9 +10000,9 @@ "dev": true }, "node_modules/table": { - "version": "6.7.3", - "resolved": "https://registry.npmjs.org/table/-/table-6.7.3.tgz", - "integrity": "sha512-5DkIxeA7XERBqMwJq0aHZOdMadBx4e6eDoFRuyT5VR82J0Ycg2DwM6GfA/EQAhJ+toRTaS1lIdSQCqgrmhPnlw==", + "version": "6.7.5", + "resolved": "https://registry.npmjs.org/table/-/table-6.7.5.tgz", + "integrity": "sha512-LFNeryOqiQHqCVKzhkymKwt6ozeRhlm8IL1mE8rNUurkir4heF6PzMyRgaTa4tlyPTGGgXuvVOF/OLWiH09Lqw==", "dev": true, "dependencies": { "ajv": "^8.0.1", @@ -9905,9 +10016,9 @@ } }, "node_modules/table/node_modules/ajv": { - "version": "8.8.1", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.8.1.tgz", - "integrity": "sha512-6CiMNDrzv0ZR916u2T+iRunnD60uWmNn8SkdB44/6stVORUg0aAkWO7PkOhpCmjmW8f2I/G/xnowD66fxGyQJg==", + "version": "8.8.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.8.2.tgz", + "integrity": "sha512-x9VuX+R/jcFj1DHo/fCp99esgGDWiHENrKxaCENuCxpoMCmAt/COCGVDwA7kleEpEzJjDnvh3yGoOuLu0Dtllw==", "dev": true, "dependencies": { "fast-deep-equal": "^3.1.1", @@ -11452,6 +11563,12 @@ } } }, + "@flatten-js/interval-tree": { + "version": "1.0.15", + "resolved": "https://registry.npmjs.org/@flatten-js/interval-tree/-/interval-tree-1.0.15.tgz", + "integrity": "sha512-ZdRHGEQIVNIUTIHGiov4PyRlSqBGnWJaS4WHuCR5fguN8E+ZACMoCXMwkUWwLtAnibFF96gtYGo/HP5qLLjioQ==", + "dev": true + }, "@humanwhocodes/config-array": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.6.0.tgz", @@ -12982,6 +13099,12 @@ "simple-swizzle": "^0.2.2" } }, + "colord": { + "version": "2.9.1", + "resolved": "https://registry.npmjs.org/colord/-/colord-2.9.1.tgz", + "integrity": "sha512-4LBMSt09vR0uLnPVkOUBnmxgoaeN4ewRbx801wY/bXcltXfpR/G46OdWn96XpYmCWuYvO46aBZP4NgX8HpNAcw==", + "dev": true + }, "colors": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz", @@ -13272,9 +13395,9 @@ } }, "debug": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", - "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", + "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==", "dev": true, "requires": { "ms": "2.1.2" @@ -17229,9 +17352,9 @@ "requires": {} }, "postcss-value-parser": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.1.0.tgz", - "integrity": "sha512-97DXOFbQJhk71ne5/Mt6cOu6yxsSfM0QGQyl0L25Gca4yGWEGJaig7l7gbCX623VqTBNGLRLaVUCnNkcedlRSQ==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz", + "integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==", "dev": true }, "prelude-ls": { @@ -17999,14 +18122,15 @@ "dev": true }, "stylelint": { - "version": "14.1.0", - "resolved": "https://registry.npmjs.org/stylelint/-/stylelint-14.1.0.tgz", - "integrity": "sha512-IedkssuNVA11+v++2PIV2OHOU5A3SfRcXVi56vZVSsMhGrgtwmmit69jeM+08/Tun5DTBe7BuH1Zp1mMLmtKLA==", + "version": "git+https://git@github.com/stylelint/stylelint.git#3901a79563ab99577bb826008d2e02fc725586da", "dev": true, + "from": "stylelint@git+https://git@github.com/stylelint/stylelint.git#warning-ranges", "requires": { + "@flatten-js/interval-tree": "^1.0.15", "balanced-match": "^2.0.0", + "colord": "^2.9.1", "cosmiconfig": "^7.0.1", - "debug": "^4.3.2", + "debug": "^4.3.3", "execall": "^2.0.0", "fast-glob": "^3.2.7", "fastest-levenshtein": "^1.0.12", @@ -18027,19 +18151,19 @@ "normalize-path": "^3.0.0", "normalize-selector": "^0.2.0", "picocolors": "^1.0.0", - "postcss": "^8.3.11", + "postcss": "^8.4.0", "postcss-media-query-parser": "^0.2.3", "postcss-resolve-nested-selector": "^0.1.1", "postcss-safe-parser": "^6.0.0", "postcss-selector-parser": "^6.0.6", - "postcss-value-parser": "^4.1.0", + "postcss-value-parser": "^4.2.0", "resolve-from": "^5.0.0", "specificity": "^0.4.1", "string-width": "^4.2.3", "strip-ansi": "^6.0.1", "style-search": "^0.1.0", "svg-tags": "^1.0.0", - "table": "^6.7.3", + "table": "^6.7.5", "v8-compile-cache": "^2.3.0", "write-file-atomic": "^3.0.3" }, @@ -18184,9 +18308,9 @@ "dev": true }, "table": { - "version": "6.7.3", - "resolved": "https://registry.npmjs.org/table/-/table-6.7.3.tgz", - "integrity": "sha512-5DkIxeA7XERBqMwJq0aHZOdMadBx4e6eDoFRuyT5VR82J0Ycg2DwM6GfA/EQAhJ+toRTaS1lIdSQCqgrmhPnlw==", + "version": "6.7.5", + "resolved": "https://registry.npmjs.org/table/-/table-6.7.5.tgz", + "integrity": "sha512-LFNeryOqiQHqCVKzhkymKwt6ozeRhlm8IL1mE8rNUurkir4heF6PzMyRgaTa4tlyPTGGgXuvVOF/OLWiH09Lqw==", "dev": true, "requires": { "ajv": "^8.0.1", @@ -18197,9 +18321,9 @@ }, "dependencies": { "ajv": { - "version": "8.8.1", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.8.1.tgz", - "integrity": "sha512-6CiMNDrzv0ZR916u2T+iRunnD60uWmNn8SkdB44/6stVORUg0aAkWO7PkOhpCmjmW8f2I/G/xnowD66fxGyQJg==", + "version": "8.8.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.8.2.tgz", + "integrity": "sha512-x9VuX+R/jcFj1DHo/fCp99esgGDWiHENrKxaCENuCxpoMCmAt/COCGVDwA7kleEpEzJjDnvh3yGoOuLu0Dtllw==", "dev": true, "requires": { "fast-deep-equal": "^3.1.1", diff --git a/package.json b/package.json index 18291942..c7ec093d 100644 --- a/package.json +++ b/package.json @@ -237,7 +237,7 @@ "postcss-sass": "^0.5.0", "postcss-scss": "^4.0.2", "prettier": "^2.5.0", - "stylelint": "^14.1.0", + "stylelint": "git+https://git@github.com/stylelint/stylelint.git#warning-ranges", "stylelint-processor-glamorous": "^0.3.0", "stylelint-processor-styled-components": "^1.10.0", "ts-jest": "^27.0.7", diff --git a/src/utils/stylelint/warning-to-diagnostic.ts b/src/utils/stylelint/warning-to-diagnostic.ts index ea537602..a5029739 100644 --- a/src/utils/stylelint/warning-to-diagnostic.ts +++ b/src/utils/stylelint/warning-to-diagnostic.ts @@ -46,7 +46,10 @@ export function warningToDiagnostic( rules?: { [name: string]: stylelint.Rule }, ): Diagnostic { const start = Position.create(warning.line - 1, warning.column - 1); - const end = Position.create(warning.line - 1, warning.column); + const end = + typeof warning.endLine === 'number' && typeof warning.endColumn === 'number' + ? Position.create(warning.endLine - 1, warning.endColumn - 1) + : Position.create(warning.line - 1, warning.column); const ruleDocUrl = rules?.[warning.rule] && `https://stylelint.io/user-guide/rules/${warning.rule}`;