mirror of
https://github.com/facebook/docusaurus.git
synced 2025-08-03 08:49:51 +02:00
fix(v2): improve stylelint copyright header rule (#2363)
* fix(v2): improve stylelint copyright header rule * Whitelist stylelint-copyright from Jest
This commit is contained in:
parent
03791ce694
commit
6cc0aa2e75
13 changed files with 113 additions and 81 deletions
58
packages/stylelint-copyright/tests/index.js
Normal file
58
packages/stylelint-copyright/tests/index.js
Normal file
|
@ -0,0 +1,58 @@
|
|||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
const testRule = require('stylelint-test-rule-tape');
|
||||
const stylelintCopyright = require('..');
|
||||
|
||||
testRule(stylelintCopyright.rule, {
|
||||
ruleName: stylelintCopyright.ruleName,
|
||||
accept: [
|
||||
{
|
||||
code: `
|
||||
/**
|
||||
* Copyright
|
||||
*/
|
||||
|
||||
.foo {}`,
|
||||
},
|
||||
{
|
||||
code: `
|
||||
/**
|
||||
* copyright
|
||||
*/
|
||||
|
||||
.foo {}`,
|
||||
},
|
||||
],
|
||||
reject: [
|
||||
{
|
||||
code: `
|
||||
/**
|
||||
* Copyleft
|
||||
*/
|
||||
|
||||
.foo {}`,
|
||||
message: `Missing copyright in the header comment (${stylelintCopyright.ruleName})`,
|
||||
line: 2,
|
||||
column: 1,
|
||||
},
|
||||
{
|
||||
code: `
|
||||
/**
|
||||
* Copyleft
|
||||
*/
|
||||
|
||||
/**
|
||||
* Copyright
|
||||
*/
|
||||
.foo {}`,
|
||||
message: `Missing copyright in the header comment (${stylelintCopyright.ruleName})`,
|
||||
line: 2,
|
||||
column: 1,
|
||||
},
|
||||
],
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue