Skip to content

Commit c58145d

Browse files
authored
update eslint (#1412)
1 parent 3a903bf commit c58145d

File tree

326 files changed

+2986
-2798
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

326 files changed

+2986
-2798
lines changed

.eslintrc.json

-45
This file was deleted.

.github/bin/format-package-json.mjs

+6-6
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,13 @@ const formatted = {};
5757

5858
formatted.funding = [
5959
{
60-
"type": "github",
61-
"url": "https://github.com/sponsors/csstools"
60+
'type': 'github',
61+
'url': 'https://github.com/sponsors/csstools',
6262
},
6363
{
64-
"type": "opencollective",
65-
"url": "https://opencollective.com/csstools"
66-
}
64+
'type': 'opencollective',
65+
'url': 'https://opencollective.com/csstools',
66+
},
6767
];
6868

6969
delete packageJSONInfo.funding;
@@ -75,7 +75,7 @@ const formatted = {};
7575
delete packageJSONInfo.private;
7676

7777
formatted.engines = {
78-
node: '^14 || ^16 || >=18'
78+
node: '^14 || ^16 || >=18',
7979
};
8080
delete packageJSONInfo.engines;
8181

.github/bin/generate-docs/api-documenter.mjs

+3-3
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ await new Promise((resolve, reject) => {
3333
],
3434
{
3535
stdio: 'inherit',
36-
shell: platform === 'win32'
37-
}
36+
shell: platform === 'win32',
37+
},
3838
);
3939

4040
publishCmd.on('close', (code) => {
@@ -49,6 +49,6 @@ await new Promise((resolve, reject) => {
4949

5050
for (const file of await getFiles('docs', true)) {
5151
const fileContents = fs.readFileSync(file, 'utf8').toString();
52-
const cleanFileContents = fileContents.replace(/\r\n/g, "\n");
52+
const cleanFileContents = fileContents.replace(/\r\n/g, '\n');
5353
fs.writeFileSync(file, cleanFileContents);
5454
}

.github/bin/generate-docs/install.mjs

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ installDoc = installDoc.replaceAll('<packagePath>', path.join(path.basename(path
1414

1515
if (packageJSONInfo?.csstools?.assumesToProcessBundledCSS) {
1616
installDoc = installDoc.replaceAll('<parallelBuildsNotice>', parallelBuildsNotice(packageJSONInfo.csstools.humanReadableName));
17-
installDoc = installDoc.replaceAll('<otherPluginsInWebpack>', `["@csstools/postcss-bundler"]`);
17+
installDoc = installDoc.replaceAll('<otherPluginsInWebpack>', '["@csstools/postcss-bundler"]');
1818
// <parallelBuildsNotice>
1919
} else {
2020
// Just a filler so that formatting doesn't become too complex.
21-
installDoc = installDoc.replaceAll('<parallelBuildsNotice>', ``);
22-
installDoc = installDoc.replaceAll('<otherPluginsInWebpack>', `// Other plugins`);
21+
installDoc = installDoc.replaceAll('<parallelBuildsNotice>', '');
22+
installDoc = installDoc.replaceAll('<otherPluginsInWebpack>', '// Other plugins');
2323
}
2424

2525
fs.writeFileSync('./INSTALL.md', installDoc);

.github/bin/generate-docs/readme.mjs

+4-4
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ let exampleFilePaths = [];
1212
try {
1313
exampleFilePaths = (
1414
await fs.promises.readdir(path.join('test', 'examples'), { recursive: true, withFileTypes: true })
15-
).filter(x => x.isFile()).map(x => path.join(x.path, x.name));
16-
} catch(error) {
15+
).filter(x => x.isFile()).map(x => path.join(x.parentPath, x.name));
16+
} catch {
1717
// No examples
1818
}
1919

@@ -60,7 +60,7 @@ readmeDoc = readmeDoc.replace('<header>', `# <humanReadableName> [<img src="http
6060
`\n
6161
\`\`\`bash
6262
npm install <packageName> --save-dev
63-
\`\`\``
63+
\`\`\``,
6464
);
6565

6666
// Insert "Usage" section
@@ -119,7 +119,7 @@ readmeDoc = readmeDoc.replaceAll('<specUrl>', packageJSONInfo.csstools.specUrl);
119119
if (packageJSONInfo?.csstools?.assumesToProcessBundledCSS) {
120120
readmeDoc = readmeDoc.replaceAll('<parallelBuildsNotice>', parallelBuildsNotice(packageJSONInfo.csstools.humanReadableName));
121121
} else {
122-
readmeDoc = readmeDoc.replaceAll('<parallelBuildsNotice>', ``);
122+
readmeDoc = readmeDoc.replaceAll('<parallelBuildsNotice>', '');
123123
}
124124

125125
for (const exampleFilePath of exampleFilePaths) {

.github/bin/license/allowed.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ const osiApproved = [
139139
'BSL-1.0',
140140
'Artistic-1.0-Perl',
141141
'NPOSL-3.0',
142-
'BlueOak-1.0.0' // https://github.com/spdx/license-list-XML/commit/d2709ad9c8c3f92989d2e7cadba3af8d1e0bc166
142+
'BlueOak-1.0.0', // https://github.com/spdx/license-list-XML/commit/d2709ad9c8c3f92989d2e7cadba3af8d1e0bc166
143143
];
144144

145145
export const osiApprovedWithCCO = [

.github/bin/list-workspaces/list-workspaces.mjs

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ export async function listWorkspaces() {
1414
const packageDirs = await getFiles(workspace.slice(0, -2), false);
1515
for (const packageDir of packageDirs) {
1616
packages.add(
17-
path.resolve(path.join(packageDir, 'package.json'))
17+
path.resolve(path.join(packageDir, 'package.json')),
1818
);
1919
}
2020
} else {
2121
packages.add(
22-
path.resolve(path.join(workspace, 'package.json'))
22+
path.resolve(path.join(workspace, 'package.json')),
2323
);
2424
}
2525
}

.github/bin/modified-workspaces/list-modified-files.mjs

+6-6
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export async function listModifiedFilesInPullRequest(repository, pullRequestNumb
88
while (true) {
99
const newFiles = await getPullRequestFiles(repository, pullRequestNumber, page);
1010
allFiles.push(...newFiles);
11-
page++
11+
page++;
1212

1313
if (newFiles.length < 100) {
1414
break;
@@ -21,8 +21,8 @@ export async function listModifiedFilesInPullRequest(repository, pullRequestNumb
2121
async function getPullRequestFiles(repository, pullRequestNumber, page) {
2222
return await (new Promise((resolve, reject) => {
2323
const headers = {
24-
'User-Agent': 'GitHub Workflow'
25-
}
24+
'User-Agent': 'GitHub Workflow',
25+
};
2626

2727
if (process.env.GITHUB_TOKEN) {
2828
headers['authorization'] = `Bearer ${process.env.GITHUB_TOKEN}`;
@@ -33,10 +33,10 @@ async function getPullRequestFiles(repository, pullRequestNumber, page) {
3333
port: 443,
3434
path: `/repos/${repository}/pulls/${pullRequestNumber}/files?per_page=100&page=${page}`,
3535
method: 'GET',
36-
headers: headers
36+
headers: headers,
3737
}, (res) => {
3838
if (!res.statusCode || (Math.floor(res.statusCode / 100) !== 2)) {
39-
throw new Error(`Unexpected response code "${res.statusCode}" with message "${res.statusMessage}"`)
39+
throw new Error(`Unexpected response code "${res.statusCode}" with message "${res.statusMessage}"`);
4040
}
4141

4242
let data = [];
@@ -46,7 +46,7 @@ async function getPullRequestFiles(repository, pullRequestNumber, page) {
4646

4747
res.on('end', () => {
4848
resolve(
49-
JSON.parse(Buffer.concat(data).toString()).map((x) => x.filename)
49+
JSON.parse(Buffer.concat(data).toString()).map((x) => x.filename),
5050
);
5151
});
5252

.github/bin/release-plan/commit.mjs

+5-5
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ export async function commitSingleDirectory(commitMessage, dir) {
1313
[
1414
'commit',
1515
'-am',
16-
commitMessage
16+
commitMessage,
1717
],
1818
{
19-
cwd: dir
20-
}
19+
cwd: dir,
20+
},
2121
);
2222

2323
let stdoutBuffer = '';
@@ -60,8 +60,8 @@ export async function commitAfterDependencyUpdates() {
6060
[
6161
'commit',
6262
'-am',
63-
`set dependencies to newly released versions`
64-
]
63+
'set dependencies to newly released versions',
64+
],
6565
);
6666

6767
let stdoutBuffer = '';

.github/bin/release-plan/discord-announce.mjs

+6-6
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ const defaultPayload = {
66
url: '',
77
description: '',
88
color: 3963146,
9-
}
10-
]
9+
},
10+
],
1111
};
1212
const BASE_URL = 'https://github.com/csstools/postcss-plugins/tree/main';
1313
const getChangelog = (changelog) => {
@@ -19,8 +19,8 @@ const getChangelog = (changelog) => {
1919
const text = changelog.slice(firstLineBreakIndex + 1, secondRelease === -1 ? undefined : secondRelease).trim();
2020

2121
// Replace relative links with absolute links
22-
return text.replace( /]\(\//g, `](${ BASE_URL }/` );
23-
}
22+
return text.replace(/]\(\//g, `](${ BASE_URL }/`);
23+
};
2424

2525
export async function discordAnnounce(workspace) {
2626
if (process.env.DEBUG) {
@@ -65,14 +65,14 @@ export async function discordAnnounceDryRun() {
6565

6666
const discordArgument = process.argv.slice(2).find(arg => arg.includes('--discord='));
6767
if (!discordArgument) {
68-
console.log(`Discord announce webhook URL: not set`);
68+
console.log('Discord announce webhook URL: not set');
6969
return;
7070
}
7171

7272
const [, webHookUrl] = discordArgument.split('=');
7373

7474
if (!webHookUrl) {
75-
console.log(`Discord announce webhook URL: not set`);
75+
console.log('Discord announce webhook URL: not set');
7676
return;
7777
}
7878

.github/bin/release-plan/docs.mjs

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ export async function updateDocumentation(packageDirectory) {
88
[
99
'run',
1010
'docs',
11-
'--if-present'
11+
'--if-present',
1212
],
1313
{
1414
cwd: packageDirectory,
15-
shell: platform === 'win32'
16-
}
15+
shell: platform === 'win32',
16+
},
1717
);
1818

1919
let stdoutBuffer = '';

.github/bin/release-plan/minify-changelog-and-package-json.mjs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import fs from 'fs/promises'
2-
import path from 'path'
1+
import fs from 'fs/promises';
2+
import path from 'path';
33

44
export async function minifyChangelogAndPackageJSON(workspace) {
55
const originalPackageInfo = JSON.parse(await fs.readFile(path.join(workspace.path, 'package.json')));
@@ -49,5 +49,5 @@ export async function minifyChangelogAndPackageJSON(workspace) {
4949
return async () => {
5050
await fs.writeFile(path.join(workspace.path, 'package.json'), JSON.stringify(originalPackageInfo, null, '\t') + '\n');
5151
await fs.writeFile(path.join(workspace.path, 'CHANGELOG.md'), originalChangelog);
52-
}
52+
};
5353
}

.github/bin/release-plan/npm-can-publish.mjs

+4-4
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ export async function canPublish(packageName, myName) {
1010
'list',
1111
'collaborators',
1212
packageName,
13-
myName
13+
myName,
1414
],
1515
{
1616
shell: platform === 'win32',
17-
stdio: 'pipe'
18-
}
17+
stdio: 'pipe',
18+
},
1919
);
2020

2121
let result = '';
@@ -43,7 +43,7 @@ export async function canPublish(packageName, myName) {
4343

4444
resolve(
4545
result.trim().includes(myName) &&
46-
result.trim().includes('read-write')
46+
result.trim().includes('read-write'),
4747
);
4848
});
4949
});

.github/bin/release-plan/npm-install.mjs

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ export async function npmInstall() {
66
const installCmd = spawn(
77
'npm',
88
[
9-
'install'
9+
'install',
1010
],
1111
{
12-
shell: platform === 'win32'
13-
}
12+
shell: platform === 'win32',
13+
},
1414
);
1515

1616
installCmd.on('close', (code) => {

.github/bin/release-plan/npm-prepublish-scripts.mjs

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ export async function npmPrepublishScripts(packageDirectory, packageName) {
1414
[
1515
'run',
1616
'prepublishOnly',
17-
'--if-present'
17+
'--if-present',
1818
],
1919
{
2020
stdio: 'inherit',
2121
cwd: packageDirectory,
22-
shell: platform === 'win32'
23-
}
22+
shell: platform === 'win32',
23+
},
2424
);
2525

2626
publishCmd.on('close', (code) => {

.github/bin/release-plan/npm-publish.mjs

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ export async function npmPublish(packageDirectory, packageName) {
1414
[
1515
'publish',
1616
'--access',
17-
'public'
17+
'public',
1818
],
1919
{
2020
stdio: 'inherit',
2121
cwd: packageDirectory,
22-
shell: platform === 'win32'
23-
}
22+
shell: platform === 'win32',
23+
},
2424
);
2525

2626
publishCmd.on('close', (code) => {

.github/bin/release-plan/npm-version.mjs

+3-3
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@ export async function npmVersion(increment, packageDirectory) {
3232
'npm',
3333
[
3434
'version',
35-
increment
35+
increment,
3636
],
3737
{
3838
cwd: packageDirectory,
39-
shell: platform === 'win32'
40-
}
39+
shell: platform === 'win32',
40+
},
4141
);
4242

4343
let stdoutBuffer = '';

0 commit comments

Comments
 (0)