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

Update stylelint-config-recommended to 5.0 #81

Merged
merged 1 commit into from
Jul 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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