diff --git a/__tests__/index.js b/__tests__/index.js index 2a482e6..0bd5bfc 100644 --- a/__tests__/index.js +++ b/__tests__/index.js @@ -6,6 +6,7 @@ const stylelint = require("stylelint"); const validCss = fs.readFileSync("./__tests__/css-valid.css", "utf-8"); const invalidCss = fs.readFileSync("./__tests__/css-invalid.css", "utf-8"); +const validScss = fs.readFileSync("./__tests__/scss-valid.scss", "utf-8"); describe("flags no warnings with valid css", () => { let result; @@ -28,6 +29,28 @@ describe("flags no warnings with valid css", () => { }); }); +describe("flags no warnings with valid scss", () => { + let result; + + beforeEach(() => { + result = stylelint.lint({ + code: validScss, + config, + syntax: "scss", + }); + }); + + it("did not error", () => { + return result.then(data => expect(data.errored).toBeFalsy()); + }); + + it("flags no warnings", () => { + return result.then(data => + expect(data.results[0].warnings).toHaveLength(0) + ); + }); +}); + describe("flags warnings with invalid css", () => { let result; diff --git a/__tests__/scss-valid.scss b/__tests__/scss-valid.scss new file mode 100644 index 0000000..6331c19 --- /dev/null +++ b/__tests__/scss-valid.scss @@ -0,0 +1,3 @@ +@use 'sass:math'; + +@import 'bootstrap'; diff --git a/index.js b/index.js index a9c3f3b..7f09a6a 100644 --- a/index.js +++ b/index.js @@ -5,6 +5,7 @@ module.exports = { plugins: ["stylelint-scss"], rules: { "at-rule-no-unknown": null, - "scss/at-rule-no-unknown": true + "scss/at-rule-no-unknown": true, + "no-invalid-position-at-import-rule": null } }; diff --git a/package-lock.json b/package-lock.json index 2751919..ba03954 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9277,9 +9277,9 @@ } }, "stylelint-config-recommended": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/stylelint-config-recommended/-/stylelint-config-recommended-3.0.0.tgz", - "integrity": "sha512-F6yTRuc06xr1h5Qw/ykb2LuFynJ2IxkKfCMf+1xqPffkxh0S09Zc902XCffcsw/XMFq/OzQ1w54fLIDtmRNHnQ==" + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/stylelint-config-recommended/-/stylelint-config-recommended-5.0.0.tgz", + "integrity": "sha512-c8aubuARSu5A3vEHLBeOSJt1udOdS+1iue7BmJDTSXoCBmfEQmmWX+59vYIj3NQdJBY6a/QRv1ozVFpaB9jaqA==" }, "stylelint-scss": { "version": "3.14.0", diff --git a/package.json b/package.json index aa7b08b..caf2dfd 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,7 @@ "stylelint-scss": "^3.0.0" }, "dependencies": { - "stylelint-config-recommended": "^3.0.0" + "stylelint-config-recommended": "^5.0.0" }, "scripts": { "dry-release": "npmpub --dry --verbose",