-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgrade to Stylelint v16,
stylelint-config-standard
v36, and `style…
…lint-config-standard-scss` v13
- Loading branch information
1 parent
23cbba7
commit ad1ef80
Showing
14 changed files
with
2,299 additions
and
5,243 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,19 @@ | ||
.element { | ||
color: #000 !important; | ||
/* Based on https://github.com/stylelint/stylelint-config-standard/blob/36.0.0/__tests__/valid.css */ | ||
|
||
@custom-media --FOO; | ||
|
||
:root { | ||
--FOO: 1px; | ||
} | ||
|
||
@keyframes FOO { | ||
/* ... */ | ||
} | ||
|
||
.FOO { | ||
/* ... */ | ||
} | ||
|
||
#FOO { | ||
/* ... */ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
// Based on https://github.com/stylelint/stylelint-config-standard/blob/36.0.0/__tests__/index.test.mjs | ||
|
||
import { | ||
beforeEach, describe, it, | ||
} from 'node:test'; | ||
import assert from 'node:assert/strict'; | ||
import fs from 'node:fs'; | ||
|
||
import stylelint from 'stylelint'; | ||
|
||
// eslint-disable-next-line import/extensions -- Specify the extension because Node is unable to detect module format. | ||
import config from '../cssModules.js'; | ||
|
||
describe('CSS Modules', () => { | ||
describe('flags no warnings with valid CSS', () => { | ||
const validCss = fs.readFileSync('./__tests__/css-modules-valid.css', 'utf-8'); | ||
let result; | ||
|
||
beforeEach(async () => { | ||
result = await stylelint.lint({ | ||
code: validCss, | ||
config, | ||
}); | ||
}); | ||
|
||
it('did not error', () => { | ||
assert.equal(result.errored, false); | ||
}); | ||
|
||
it('flags no warnings', () => { | ||
assert.equal(result.results[0].warnings.length, 0); | ||
}); | ||
}); | ||
|
||
describe('deprecated rules are excluded', () => { | ||
const ruleNames = Object.keys(config.rules); | ||
|
||
it('is not empty', () => { | ||
assert.ok(ruleNames.length > 0); | ||
}); | ||
|
||
// eslint-disable-next-line no-restricted-syntax -- Keep the test copied from `stylelint-config-standard` as is. | ||
for (const ruleName of ruleNames) { | ||
it(`${ruleName}`, async () => { | ||
const rule = await stylelint.rules[ruleName]; | ||
|
||
assert.ok(!rule.meta.deprecated); | ||
}); | ||
} | ||
}); | ||
}); |
Oops, something went wrong.