mirror of
https://github.com/facebook/docusaurus.git
synced 2025-04-29 10:17:55 +02:00
* fix(v2): improve stylelint copyright header rule * Whitelist stylelint-copyright from Jest
58 lines
913 B
JavaScript
58 lines
913 B
JavaScript
/**
|
|
* 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,
|
|
},
|
|
],
|
|
});
|