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:
Rémi Doreau 2020-03-21 05:42:10 +01:00 committed by GitHub
parent ce45413804
commit b4f4057d97
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 201 additions and 594 deletions

View file

@ -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,
},

View file

@ -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"
}
}