Skip to content

Commit 37247fb

Browse files
authored
chore: Upgrade eslint (#3509)
1 parent c3faf5c commit 37247fb

File tree

133 files changed

+1106
-923
lines changed

Some content is hidden

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

133 files changed

+1106
-923
lines changed

.eslintrc.js

Lines changed: 0 additions & 331 deletions
This file was deleted.

.github/workflows/bundle-size/build.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
1+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
// SPDX-License-Identifier: Apache-2.0
13
import { build } from 'esbuild';
2-
import { gzip } from 'node:zlib';
3-
import { promisify } from 'node:util';
4-
import { unlinkSync, readFileSync, writeFileSync } from 'node:fs';
4+
import { readFileSync, unlinkSync, writeFileSync } from 'node:fs';
55
import path from 'node:path';
6+
import { promisify } from 'node:util';
7+
import { gzip } from 'node:zlib';
68

79
const compress = promisify(gzip);
810

911
function concatFiles(files) {
10-
return files.reduce((total, current) => total + current.text ?? '', '');
12+
return files.reduce((total, current) => total + (current.text ?? ''), '');
1113
}
1214

1315
function getInstalledVersions(projectRoot) {
@@ -21,7 +23,9 @@ function getInstalledVersions(projectRoot) {
2123
async function main() {
2224
try {
2325
unlinkSync('output.json');
24-
} catch (e) {}
26+
} catch {
27+
// no-op
28+
}
2529

2630
const result = await build({
2731
entryPoints: ['main.js'],

.github/workflows/bundle-size/main.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
// SPDX-License-Identifier: Apache-2.0
13
export * from '../components/lib/components';

.github/workflows/bundle-size/status-report.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
// SPDX-License-Identifier: Apache-2.0
13
import { readFileSync } from 'node:fs';
24

35
function readJson(filename) {

build-tools/eslint/__tests__/ban-files.test.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const ruleWildcardPath = [
1616
},
1717
];
1818
const defaultRules = [...ruleHardcodedPath, ...ruleWildcardPath];
19-
const ruleTester = new RuleTester({ parserOptions: { ecmaVersion: 2018, sourceType: 'module' } });
19+
const ruleTester = new RuleTester();
2020

2121
ruleTester.run('ban-files', banFiles, {
2222
valid: [
@@ -51,12 +51,6 @@ ruleTester.run('ban-files', banFiles, {
5151
options: [ruleHardcodedPath],
5252
errors: [{ message: "Disallowed import 'src/index.ts' in favor of having smaller bundle sizes." }],
5353
},
54-
{
55-
code: 'import "../index"',
56-
filename: './src/button/index.tsx',
57-
options: [ruleHardcodedPath],
58-
errors: [{ message: "Disallowed import 'src/index.ts' in favor of having smaller bundle sizes." }],
59-
},
6054
{
6155
code: 'import "../button"',
6256
filename: './src/alert/index.tsx',

0 commit comments

Comments
 (0)