misc: convert all internal scripts to ESM (#6286)

* misc: convert all internal scripts to ESM

* fixes

* fix

* fixes

* fix!

* complete eslint

* more move

* fix!

* This looks better?

* Final ones
This commit is contained in:
Joshua Chen 2022-01-08 12:59:28 +08:00 committed by GitHub
parent bcc05e243f
commit 4fad1ce0cd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
66 changed files with 412 additions and 374 deletions

View file

@ -1,70 +0,0 @@
/**
* 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 path = require('path');
const rule = require('..');
const {ruleName, messages} = rule;
testStylelintRule(
{
// Relative to repo root.
plugins: [path.join(process.cwd(), 'packages', 'stylelint-copyright')],
rules: {
[ruleName]: true,
},
},
{
ruleName,
fix: false,
accept: [
{
code: `
/**
* Copyright
*/
.foo {}`,
},
{
code: `
/**
* copyright
*/
.foo {}`,
},
],
reject: [
{
code: `
/**
* Copyleft
*/
.foo {}`,
message: messages.rejected,
line: 2,
column: 1,
},
{
code: `
/**
* Copyleft
*/
/**
* Copyright
*/
.foo {}`,
message: messages.rejected,
line: 2,
column: 1,
},
],
},
);