Skip to content

Commit

Permalink
Merge pull request #81 from kristerkari/update-stylelint-config-recom…
Browse files Browse the repository at this point in the history
…mended

Update `stylelint-config-recommended` to 5.0
  • Loading branch information
kristerkari committed Jul 8, 2021
2 parents 293f450 + 54cbd08 commit c703ac7
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 5 deletions.
23 changes: 23 additions & 0 deletions __tests__/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;

Expand Down
3 changes: 3 additions & 0 deletions __tests__/scss-valid.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@use 'sass:math';

@import 'bootstrap';
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
};
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit c703ac7

Please sign in to comment.