mirror of
https://github.com/facebook/docusaurus.git
synced 2025-08-03 16:59:06 +02:00
misc: improve stylelint rule (#2415)
* feat(header-lint): allow for rule configuration * test(stylelint-copyright): moove implementation to jest * test(stylelint-copyright): add missing check * test(jest-setup): add linter
This commit is contained in:
parent
ce45413804
commit
b4f4057d97
6 changed files with 201 additions and 594 deletions
|
@ -5,11 +5,13 @@
|
|||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
const testRule = require('stylelint-test-rule-tape');
|
||||
const stylelintCopyright = require('..');
|
||||
const rule = require('..');
|
||||
|
||||
testRule(stylelintCopyright.rule, {
|
||||
ruleName: stylelintCopyright.ruleName,
|
||||
const {ruleName, messages} = rule;
|
||||
|
||||
testRule(rule, {
|
||||
ruleName,
|
||||
fix: false,
|
||||
accept: [
|
||||
{
|
||||
code: `
|
||||
|
@ -36,7 +38,7 @@ testRule(stylelintCopyright.rule, {
|
|||
*/
|
||||
|
||||
.foo {}`,
|
||||
message: `Missing copyright in the header comment (${stylelintCopyright.ruleName})`,
|
||||
message: messages.rejected,
|
||||
line: 2,
|
||||
column: 1,
|
||||
},
|
||||
|
@ -50,7 +52,7 @@ testRule(stylelintCopyright.rule, {
|
|||
* Copyright
|
||||
*/
|
||||
.foo {}`,
|
||||
message: `Missing copyright in the header comment (${stylelintCopyright.ruleName})`,
|
||||
message: messages.rejected,
|
||||
line: 2,
|
||||
column: 1,
|
||||
},
|
|
@ -4,11 +4,7 @@
|
|||
"description": "stylelint plugin to check css files for a copyright header",
|
||||
"main": "index.js",
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"test": "node tests"
|
||||
},
|
||||
"dependencies": {
|
||||
"stylelint": "^13.2.0",
|
||||
"stylelint-test-rule-tape": "^0.2.0"
|
||||
"stylelint": "^13.2.0"
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue