Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
331 changes: 0 additions & 331 deletions .eslintrc.js

This file was deleted.

14 changes: 9 additions & 5 deletions .github/workflows/bundle-size/build.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated eslint captured all JS/TS files in our repo, not just src

import { build } from 'esbuild';
import { gzip } from 'node:zlib';
import { promisify } from 'node:util';
import { unlinkSync, readFileSync, writeFileSync } from 'node:fs';
import { readFileSync, unlinkSync, writeFileSync } from 'node:fs';
import path from 'node:path';
import { promisify } from 'node:util';
import { gzip } from 'node:zlib';

const compress = promisify(gzip);

function concatFiles(files) {
return files.reduce((total, current) => total + current.text ?? '', '');
return files.reduce((total, current) => total + (current.text ?? ''), '');
}

function getInstalledVersions(projectRoot) {
Expand All @@ -21,7 +23,9 @@ function getInstalledVersions(projectRoot) {
async function main() {
try {
unlinkSync('output.json');
} catch (e) {}
} catch {
// no-op
}

const result = await build({
entryPoints: ['main.js'],
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/bundle-size/main.js
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
export * from '../components/lib/components';
2 changes: 2 additions & 0 deletions .github/workflows/bundle-size/status-report.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
import { readFileSync } from 'node:fs';

function readJson(filename) {
Expand Down
8 changes: 1 addition & 7 deletions build-tools/eslint/__tests__/ban-files.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const ruleWildcardPath = [
},
];
const defaultRules = [...ruleHardcodedPath, ...ruleWildcardPath];
const ruleTester = new RuleTester({ parserOptions: { ecmaVersion: 2018, sourceType: 'module' } });
const ruleTester = new RuleTester();

ruleTester.run('ban-files', banFiles, {
valid: [
Expand Down Expand Up @@ -51,12 +51,6 @@ ruleTester.run('ban-files', banFiles, {
options: [ruleHardcodedPath],
errors: [{ message: "Disallowed import 'src/index.ts' in favor of having smaller bundle sizes." }],
},
{
code: 'import "../index"',
filename: './src/button/index.tsx',
options: [ruleHardcodedPath],
errors: [{ message: "Disallowed import 'src/index.ts' in favor of having smaller bundle sizes." }],
},
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicated test. The new version detects and calls this out

{
code: 'import "../button"',
filename: './src/alert/index.tsx',
Expand Down
Loading
Loading