From 45c49dc23273632f55953ef70544f1d5fccb8461 Mon Sep 17 00:00:00 2001 From: Sam Seay Date: Tue, 15 Aug 2023 14:21:51 +0800 Subject: [PATCH] Add a workflow to separate out eslint and annotate PRs. (#39704) --- .github/workflows/pr-lint-js.yml | 40 +++++++++++++++++++ .../{pr-lint-test-js.yml => pr-test-js.yml} | 5 +-- .../scripts/collect-eslint-reports.js | 34 ++++++++++++++++ .gitignore | 3 +- .../changelog/dev-include-eslint-annotations | 4 ++ packages/js/admin-e2e-tests/package.json | 2 +- .../changelog/dev-include-eslint-annotations | 4 ++ packages/js/admin-layout/package.json | 2 +- .../changelog/dev-include-eslint-annotations | 4 ++ packages/js/ai/package.json | 2 +- .../changelog/dev-include-eslint-annotations | 4 ++ packages/js/api/package.json | 2 +- .../changelog/dev-include-eslint-annotations | 4 ++ packages/js/components/package.json | 4 +- .../changelog/dev-include-eslint-annotations | 4 ++ packages/js/csv-export/package.json | 2 +- .../changelog/dev-include-eslint-annotations | 4 ++ packages/js/currency/package.json | 2 +- .../changelog/dev-include-eslint-annotations | 4 ++ .../js/customer-effort-score/package.json | 2 +- .../changelog/dev-include-eslint-annotations | 4 ++ packages/js/data/package.json | 2 +- .../changelog/dev-include-eslint-annotations | 4 ++ packages/js/date/package.json | 2 +- .../changelog/dev-include-eslint-annotations | 4 ++ .../package.json | 2 +- packages/js/e2e-core-tests/package.json | 4 +- packages/js/e2e-environment/package.json | 4 +- packages/js/e2e-utils/package.json | 4 +- .../changelog/dev-include-eslint-annotations | 4 ++ packages/js/experimental/package.json | 2 +- .../changelog/dev-include-eslint-annotations | 4 ++ packages/js/explat/package.json | 2 +- packages/js/internal-js-tests/package.json | 2 +- .../changelog/dev-include-eslint-annotations | 4 ++ packages/js/navigation/package.json | 2 +- packages/js/notices/package.json | 2 +- .../changelog/dev-include-eslint-annotations | 4 ++ packages/js/number/package.json | 2 +- .../changelog/dev-include-eslint-annotations | 4 ++ packages/js/onboarding/package.json | 2 +- .../changelog/dev-include-eslint-annotations | 4 ++ packages/js/product-editor/package.json | 2 +- .../changelog/dev-include-eslint-annotations | 4 ++ packages/js/tracks/package.json | 2 +- 45 files changed, 176 insertions(+), 32 deletions(-) create mode 100644 .github/workflows/pr-lint-js.yml rename .github/workflows/{pr-lint-test-js.yml => pr-test-js.yml} (74%) create mode 100644 .github/workflows/scripts/collect-eslint-reports.js create mode 100644 packages/js/admin-e2e-tests/changelog/dev-include-eslint-annotations create mode 100644 packages/js/admin-layout/changelog/dev-include-eslint-annotations create mode 100644 packages/js/ai/changelog/dev-include-eslint-annotations create mode 100644 packages/js/api/changelog/dev-include-eslint-annotations create mode 100644 packages/js/components/changelog/dev-include-eslint-annotations create mode 100644 packages/js/csv-export/changelog/dev-include-eslint-annotations create mode 100644 packages/js/currency/changelog/dev-include-eslint-annotations create mode 100644 packages/js/customer-effort-score/changelog/dev-include-eslint-annotations create mode 100644 packages/js/data/changelog/dev-include-eslint-annotations create mode 100644 packages/js/date/changelog/dev-include-eslint-annotations create mode 100644 packages/js/dependency-extraction-webpack-plugin/changelog/dev-include-eslint-annotations create mode 100644 packages/js/experimental/changelog/dev-include-eslint-annotations create mode 100644 packages/js/explat/changelog/dev-include-eslint-annotations create mode 100644 packages/js/navigation/changelog/dev-include-eslint-annotations create mode 100644 packages/js/number/changelog/dev-include-eslint-annotations create mode 100644 packages/js/onboarding/changelog/dev-include-eslint-annotations create mode 100644 packages/js/product-editor/changelog/dev-include-eslint-annotations create mode 100644 packages/js/tracks/changelog/dev-include-eslint-annotations diff --git a/.github/workflows/pr-lint-js.yml b/.github/workflows/pr-lint-js.yml new file mode 100644 index 00000000000..cee0eacd9c5 --- /dev/null +++ b/.github/workflows/pr-lint-js.yml @@ -0,0 +1,40 @@ +name: Lint JS packages + +on: + pull_request: + paths-ignore: + - '**/changelog/**' +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +permissions: {} + +jobs: + lint-test-js: + name: Lint + runs-on: ubuntu-20.04 + permissions: + contents: read + # This is required to allow the action to annotate the PR with the linting results. + checks: write + pull-requests: read + steps: + - uses: actions/checkout@v3 + + - name: Setup WooCommerce Monorepo + uses: ./.github/actions/setup-woocommerce-monorepo + + - name: Lint + run: pnpm run -r --filter='release-posts' --filter='woocommerce/client/admin...' --filter='@woocommerce/monorepo-utils' --filter='!@woocommerce/e2e*' --filter='!@woocommerce/api' --color lint + continue-on-error: true + + - name: Collect and Combine Eslint Reports + run: node ./.github/workflows/scripts/collect-eslint-reports.js + + - name: Annotate Code Linting Results + uses: ataylorme/eslint-annotate-action@a1bf7cb320a18aa53cb848a267ce9b7417221526 + + with: + repo-token: '${{ secrets.GITHUB_TOKEN }}' + report-json: 'combined_eslint_report.json' diff --git a/.github/workflows/pr-lint-test-js.yml b/.github/workflows/pr-test-js.yml similarity index 74% rename from .github/workflows/pr-lint-test-js.yml rename to .github/workflows/pr-test-js.yml index 9521191858a..31e58e71614 100644 --- a/.github/workflows/pr-lint-test-js.yml +++ b/.github/workflows/pr-test-js.yml @@ -12,7 +12,7 @@ permissions: {} jobs: lint-test-js: - name: Lint and Test JS + name: Run JS Tests runs-on: ubuntu-20.04 permissions: contents: read @@ -22,8 +22,5 @@ jobs: - name: Setup WooCommerce Monorepo uses: ./.github/actions/setup-woocommerce-monorepo - - name: Lint - run: pnpm run -r --filter='release-posts' --filter='woocommerce/client/admin...' --filter='@woocommerce/monorepo-utils' --filter='!@woocommerce/e2e*' --filter='!@woocommerce/api' --color lint - - name: Test run: pnpm run test --filter='woocommerce/client/admin...' --filter='@woocommerce/monorepo-utils' --filter='!@woocommerce/e2e*' --filter='@woocommerce/monorepo-utils' --filter='!@woocommerce/api' --color diff --git a/.github/workflows/scripts/collect-eslint-reports.js b/.github/workflows/scripts/collect-eslint-reports.js new file mode 100644 index 00000000000..2d2d2dc2499 --- /dev/null +++ b/.github/workflows/scripts/collect-eslint-reports.js @@ -0,0 +1,34 @@ +const fs = require( 'fs' ); +const path = require( 'path' ); + +const rootDirectory = path.resolve( __dirname, '..', '..', '..' ); + +const allReports = []; + +function collectReports( directory ) { + const files = fs.readdirSync( directory ); + for ( const file of files ) { + const fullPath = path.join( directory, file ); + const isDirectory = fs.statSync( fullPath ).isDirectory(); + + if ( isDirectory && file !== 'node_modules' && file !== 'vendor' ) { + const reportPath = path.join( fullPath, 'eslint_report.json' ); + if ( fs.existsSync( reportPath ) ) { + // an array of items + const report = require( reportPath ); + + // add the report to the allReports array + allReports.push( ...report ); + } + + collectReports( fullPath ); + } + } +} + +collectReports( rootDirectory ); + +fs.writeFileSync( + 'combined_eslint_report.json', + JSON.stringify( allReports, null, 2 ) +); diff --git a/.gitignore b/.gitignore index f90547dcb5a..ed180664a57 100644 --- a/.gitignore +++ b/.gitignore @@ -22,8 +22,9 @@ none # Logs logs/ -# Eslint Cache +# Eslint .eslintcache +eslint_report.json # Environment files wp-cli.local.yml diff --git a/packages/js/admin-e2e-tests/changelog/dev-include-eslint-annotations b/packages/js/admin-e2e-tests/changelog/dev-include-eslint-annotations new file mode 100644 index 00000000000..bded8d77ece --- /dev/null +++ b/packages/js/admin-e2e-tests/changelog/dev-include-eslint-annotations @@ -0,0 +1,4 @@ +Significance: patch +Type: dev + +Make eslint emit JSON report for annotating PRs. diff --git a/packages/js/admin-e2e-tests/package.json b/packages/js/admin-e2e-tests/package.json index f4f381e07b4..079023c2fdc 100644 --- a/packages/js/admin-e2e-tests/package.json +++ b/packages/js/admin-e2e-tests/package.json @@ -60,7 +60,7 @@ "prepare": "composer install", "changelog": "composer exec -- changelogger", "build": "pnpm -w exec turbo run turbo:build --filter=$npm_package_name", - "lint": "eslint src", + "lint": "eslint --output-file eslint_report.json --format json src", "start": "tsc --project tsconfig.json --watch", "clean": "pnpm exec rimraf tsconfig.tsbuildinfo build build-*", "lint:fix": "eslint src --fix", diff --git a/packages/js/admin-layout/changelog/dev-include-eslint-annotations b/packages/js/admin-layout/changelog/dev-include-eslint-annotations new file mode 100644 index 00000000000..bded8d77ece --- /dev/null +++ b/packages/js/admin-layout/changelog/dev-include-eslint-annotations @@ -0,0 +1,4 @@ +Significance: patch +Type: dev + +Make eslint emit JSON report for annotating PRs. diff --git a/packages/js/admin-layout/package.json b/packages/js/admin-layout/package.json index e222502f948..dcdbd209461 100644 --- a/packages/js/admin-layout/package.json +++ b/packages/js/admin-layout/package.json @@ -33,7 +33,7 @@ "changelog": "composer exec -- changelogger", "clean": "pnpm exec rimraf tsconfig.tsbuildinfo build build-*", "build": "pnpm -w exec turbo run turbo:build --filter=$npm_package_name", - "lint": "eslint src", + "lint": "eslint --output-file eslint_report.json --format json src", "build:js": "tsc --project tsconfig.json && tsc --project tsconfig-cjs.json", "build:css": "webpack", "start": "concurrently \"tsc --project tsconfig.json --watch\" \"tsc --project tsconfig-cjs.json --watch\" \"webpack --watch\"", diff --git a/packages/js/ai/changelog/dev-include-eslint-annotations b/packages/js/ai/changelog/dev-include-eslint-annotations new file mode 100644 index 00000000000..bded8d77ece --- /dev/null +++ b/packages/js/ai/changelog/dev-include-eslint-annotations @@ -0,0 +1,4 @@ +Significance: patch +Type: dev + +Make eslint emit JSON report for annotating PRs. diff --git a/packages/js/ai/package.json b/packages/js/ai/package.json index f04636127b3..c400d6eb3c6 100644 --- a/packages/js/ai/package.json +++ b/packages/js/ai/package.json @@ -79,7 +79,7 @@ "clean": "pnpm exec rimraf tsconfig.tsbuildinfo build build-*", "build": "pnpm -w exec turbo run turbo:build --filter=$npm_package_name", "test": "pnpm -w exec turbo run turbo:test --filter=$npm_package_name", - "lint": "eslint src", + "lint": "eslint --output-file eslint_report.json --format json src", "build:js": "tsc --project tsconfig.json && tsc --project tsconfig-cjs.json", "build:css": "webpack", "start": "concurrently \"tsc --project tsconfig.json --watch\" \"tsc --project tsconfig-cjs.json --watch\" \"webpack --watch\"", diff --git a/packages/js/api/changelog/dev-include-eslint-annotations b/packages/js/api/changelog/dev-include-eslint-annotations new file mode 100644 index 00000000000..bded8d77ece --- /dev/null +++ b/packages/js/api/changelog/dev-include-eslint-annotations @@ -0,0 +1,4 @@ +Significance: patch +Type: dev + +Make eslint emit JSON report for annotating PRs. diff --git a/packages/js/api/package.json b/packages/js/api/package.json index e927ea92d06..d647ddf60c8 100644 --- a/packages/js/api/package.json +++ b/packages/js/api/package.json @@ -39,7 +39,7 @@ "compile": "tsc --project tsconfig.json", "prepack": "pnpm run build", "build": "pnpm -w exec turbo run turbo:build --filter=$npm_package_name", - "lint": "eslint src", + "lint": "eslint --output-file eslint_report.json --format json src", "lint:fix": "eslint src --fix" }, "dependencies": { diff --git a/packages/js/components/changelog/dev-include-eslint-annotations b/packages/js/components/changelog/dev-include-eslint-annotations new file mode 100644 index 00000000000..bded8d77ece --- /dev/null +++ b/packages/js/components/changelog/dev-include-eslint-annotations @@ -0,0 +1,4 @@ +Significance: patch +Type: dev + +Make eslint emit JSON report for annotating PRs. diff --git a/packages/js/components/package.json b/packages/js/components/package.json index 0d75909e08b..c84f58dd95a 100644 --- a/packages/js/components/package.json +++ b/packages/js/components/package.json @@ -154,11 +154,11 @@ "changelog": "composer exec -- changelogger", "build": "pnpm -w exec turbo run turbo:build --filter=$npm_package_name", "test": "pnpm -w exec turbo run turbo:test --filter=$npm_package_name", - "lint": "eslint src --ext=js,ts,tsx", + "lint": "eslint --output-file eslint_report.json --format json --ext=js,ts,tsx src", "build:js": "tsc --project tsconfig.json && tsc --project tsconfig-cjs.json", "build:css": "webpack", "clean": "pnpm exec rimraf tsconfig.tsbuildinfo build build-*", - "lint:fix": "eslint src --ext=js,ts,tsx --fix", + "lint:fix": "eslint --output-file eslint_report.json --format json --ext=js,ts,tsx src --fix", "prepack": "pnpm run clean && pnpm run build", "start": "concurrently \"tsc --project tsconfig.json --watch\" \"tsc --project tsconfig-cjs.json --watch\" \"webpack --watch\"", "test:update-snapshots": "pnpm run test -- --updateSnapshot", diff --git a/packages/js/csv-export/changelog/dev-include-eslint-annotations b/packages/js/csv-export/changelog/dev-include-eslint-annotations new file mode 100644 index 00000000000..bded8d77ece --- /dev/null +++ b/packages/js/csv-export/changelog/dev-include-eslint-annotations @@ -0,0 +1,4 @@ +Significance: patch +Type: dev + +Make eslint emit JSON report for annotating PRs. diff --git a/packages/js/csv-export/package.json b/packages/js/csv-export/package.json index 808fd1f88aa..2796700ad95 100644 --- a/packages/js/csv-export/package.json +++ b/packages/js/csv-export/package.json @@ -41,7 +41,7 @@ "clean": "pnpm exec rimraf tsconfig.tsbuildinfo build build-*", "build": "pnpm -w exec turbo run turbo:build --filter=$npm_package_name", "test": "pnpm -w exec turbo run turbo:test --filter=$npm_package_name", - "lint": "eslint src", + "lint": "eslint --output-file eslint_report.json --format json src", "start": "concurrently \"tsc --project tsconfig.json --watch\" \"tsc --project tsconfig-cjs.json --watch\"", "prepack": "pnpm run clean && pnpm run build", "lint:fix": "eslint src --fix", diff --git a/packages/js/currency/changelog/dev-include-eslint-annotations b/packages/js/currency/changelog/dev-include-eslint-annotations new file mode 100644 index 00000000000..bded8d77ece --- /dev/null +++ b/packages/js/currency/changelog/dev-include-eslint-annotations @@ -0,0 +1,4 @@ +Significance: patch +Type: dev + +Make eslint emit JSON report for annotating PRs. diff --git a/packages/js/currency/package.json b/packages/js/currency/package.json index 358275ae0c3..e89fa8ebb22 100644 --- a/packages/js/currency/package.json +++ b/packages/js/currency/package.json @@ -44,7 +44,7 @@ "clean": "pnpm exec rimraf tsconfig.tsbuildinfo build build-*", "build": "pnpm -w exec turbo run turbo:build --filter=$npm_package_name", "test": "pnpm -w exec turbo run turbo:test --filter=$npm_package_name", - "lint": "eslint src", + "lint": "eslint --output-file eslint_report.json --format json src", "start": "concurrently \"tsc --project tsconfig.json --watch\" \"tsc --project tsconfig-cjs.json --watch\"", "prepack": "pnpm run clean && pnpm run build", "lint:fix": "eslint src --fix", diff --git a/packages/js/customer-effort-score/changelog/dev-include-eslint-annotations b/packages/js/customer-effort-score/changelog/dev-include-eslint-annotations new file mode 100644 index 00000000000..bded8d77ece --- /dev/null +++ b/packages/js/customer-effort-score/changelog/dev-include-eslint-annotations @@ -0,0 +1,4 @@ +Significance: patch +Type: dev + +Make eslint emit JSON report for annotating PRs. diff --git a/packages/js/customer-effort-score/package.json b/packages/js/customer-effort-score/package.json index fa87e19f543..88304dfd4df 100644 --- a/packages/js/customer-effort-score/package.json +++ b/packages/js/customer-effort-score/package.json @@ -80,7 +80,7 @@ "clean": "pnpm exec rimraf tsconfig.tsbuildinfo build build-*", "build": "pnpm -w exec turbo run turbo:build --filter=$npm_package_name", "test": "pnpm -w exec turbo run turbo:test --filter=$npm_package_name", - "lint": "eslint src", + "lint": "eslint --output-file eslint_report.json --format json src", "build:js": "tsc --project tsconfig.json && tsc --project tsconfig-cjs.json", "build:css": "webpack", "start": "concurrently \"tsc --project tsconfig.json --watch\" \"tsc --project tsconfig-cjs.json --watch\" \"webpack --watch\"", diff --git a/packages/js/data/changelog/dev-include-eslint-annotations b/packages/js/data/changelog/dev-include-eslint-annotations new file mode 100644 index 00000000000..bded8d77ece --- /dev/null +++ b/packages/js/data/changelog/dev-include-eslint-annotations @@ -0,0 +1,4 @@ +Significance: patch +Type: dev + +Make eslint emit JSON report for annotating PRs. diff --git a/packages/js/data/package.json b/packages/js/data/package.json index 56c521a91ef..b4235253e43 100644 --- a/packages/js/data/package.json +++ b/packages/js/data/package.json @@ -87,7 +87,7 @@ "clean": "pnpm exec rimraf tsconfig.tsbuildinfo build build-*", "build": "pnpm -w exec turbo run turbo:build --filter=$npm_package_name", "test": "pnpm -w exec turbo run turbo:test --filter=$npm_package_name", - "lint": "eslint src", + "lint": "eslint --output-file eslint_report.json --format json src", "start": "concurrently \"tsc --project tsconfig.json --watch\" \"tsc --project tsconfig-cjs.json --watch\"", "prepack": "pnpm run clean && pnpm run build", "lint:fix": "eslint src --fix", diff --git a/packages/js/date/changelog/dev-include-eslint-annotations b/packages/js/date/changelog/dev-include-eslint-annotations new file mode 100644 index 00000000000..bded8d77ece --- /dev/null +++ b/packages/js/date/changelog/dev-include-eslint-annotations @@ -0,0 +1,4 @@ +Significance: patch +Type: dev + +Make eslint emit JSON report for annotating PRs. diff --git a/packages/js/date/package.json b/packages/js/date/package.json index 9f4e10207f4..f4702b0132f 100644 --- a/packages/js/date/package.json +++ b/packages/js/date/package.json @@ -64,7 +64,7 @@ "clean": "pnpm exec rimraf tsconfig.tsbuildinfo build build-*", "build": "pnpm -w exec turbo run turbo:build --filter=$npm_package_name", "test": "pnpm -w exec turbo run turbo:test --filter=$npm_package_name", - "lint": "eslint src", + "lint": "eslint --output-file eslint_report.json --format json src", "start": "concurrently \"tsc --project tsconfig.json --watch\" \"tsc --project tsconfig-cjs.json --watch\"", "prepack": "pnpm run clean && pnpm run build", "lint:fix": "eslint src --fix", diff --git a/packages/js/dependency-extraction-webpack-plugin/changelog/dev-include-eslint-annotations b/packages/js/dependency-extraction-webpack-plugin/changelog/dev-include-eslint-annotations new file mode 100644 index 00000000000..bded8d77ece --- /dev/null +++ b/packages/js/dependency-extraction-webpack-plugin/changelog/dev-include-eslint-annotations @@ -0,0 +1,4 @@ +Significance: patch +Type: dev + +Make eslint emit JSON report for annotating PRs. diff --git a/packages/js/dependency-extraction-webpack-plugin/package.json b/packages/js/dependency-extraction-webpack-plugin/package.json index 64cde920e15..ef8709f584f 100644 --- a/packages/js/dependency-extraction-webpack-plugin/package.json +++ b/packages/js/dependency-extraction-webpack-plugin/package.json @@ -42,7 +42,7 @@ "scripts": { "prepare": "composer install", "changelog": "composer exec -- changelogger", - "lint": "eslint src", + "lint": "eslint --output-file eslint_report.json --format json src", "lint:fix": "eslint src --fix" }, "lint-staged": { diff --git a/packages/js/e2e-core-tests/package.json b/packages/js/e2e-core-tests/package.json index 8bbf35a8336..a65605e949a 100644 --- a/packages/js/e2e-core-tests/package.json +++ b/packages/js/e2e-core-tests/package.json @@ -57,8 +57,8 @@ "build": "pnpm -w exec turbo run turbo:build --filter=$npm_package_name", "clean": "rm -rf ./build ./build-module", "compile": "e2e-builds", - "lint": "eslint src --ext=js,ts,tsx", - "lint:fix": "eslint src --ext=js,ts,tsx --fix" + "lint": "eslint --output-file eslint_report.json --format json --ext=js,ts,tsx src", + "lint:fix": "eslint --output-file eslint_report.json --format json --ext=js,ts,tsx src --fix" }, "lint-staged": { "*.(t|j)s?(x)": [ diff --git a/packages/js/e2e-environment/package.json b/packages/js/e2e-environment/package.json index 4ba3035ec35..c3ee768e7ee 100644 --- a/packages/js/e2e-environment/package.json +++ b/packages/js/e2e-environment/package.json @@ -78,8 +78,8 @@ "test:e2e": "bash ./bin/wait-for-build.sh && ./bin/e2e-test-integration.js", "test:e2e-debug": "bash ./bin/wait-for-build.sh && ./bin/e2e-test-integration.js --dev --debug", "test:e2e-dev": "bash ./bin/wait-for-build.sh && ./bin/e2e-test-integration.js --dev", - "lint": "eslint src --ext=js,ts,tsx", - "lint:fix": "eslint src --ext=js,ts,tsx --fix" + "lint": "eslint --output-file eslint_report.json --format json --ext=js,ts,tsx src", + "lint:fix": "eslint --output-file eslint_report.json --format json --ext=js,ts,tsx src --fix" }, "bin": { "wc-e2e": "bin/wc-e2e.sh" diff --git a/packages/js/e2e-utils/package.json b/packages/js/e2e-utils/package.json index d519acf1831..81a08d956f9 100644 --- a/packages/js/e2e-utils/package.json +++ b/packages/js/e2e-utils/package.json @@ -52,8 +52,8 @@ "clean": "rm -rf ./build ./build-module", "compile": "e2e-builds", "prepack": "pnpm run build", - "lint": "eslint src --ext=js,ts,tsx", - "lint:fix": "eslint src --ext=js,ts,tsx --fix" + "lint": "eslint --output-file eslint_report.json --format json --ext=js,ts,tsx src", + "lint:fix": "eslint --output-file eslint_report.json --format json --ext=js,ts,tsx src --fix" }, "lint-staged": { "*.(t|j)s?(x)": [ diff --git a/packages/js/experimental/changelog/dev-include-eslint-annotations b/packages/js/experimental/changelog/dev-include-eslint-annotations new file mode 100644 index 00000000000..bded8d77ece --- /dev/null +++ b/packages/js/experimental/changelog/dev-include-eslint-annotations @@ -0,0 +1,4 @@ +Significance: patch +Type: dev + +Make eslint emit JSON report for annotating PRs. diff --git a/packages/js/experimental/package.json b/packages/js/experimental/package.json index 90ddbc747a8..935891113bb 100644 --- a/packages/js/experimental/package.json +++ b/packages/js/experimental/package.json @@ -90,7 +90,7 @@ "clean": "pnpm exec rimraf tsconfig.tsbuildinfo build build-*", "build": "pnpm -w exec turbo run turbo:build --filter=$npm_package_name", "test": "pnpm -w exec turbo run turbo:test --filter=$npm_package_name", - "lint": "eslint src", + "lint": "eslint --output-file eslint_report.json --format json src", "build:js": "tsc --project tsconfig.json && tsc --project tsconfig-cjs.json", "build:css": "webpack", "start": "concurrently \"tsc --project tsconfig.json --watch\" \"tsc --project tsconfig-cjs.json --watch\" \"webpack --watch\"", diff --git a/packages/js/explat/changelog/dev-include-eslint-annotations b/packages/js/explat/changelog/dev-include-eslint-annotations new file mode 100644 index 00000000000..bded8d77ece --- /dev/null +++ b/packages/js/explat/changelog/dev-include-eslint-annotations @@ -0,0 +1,4 @@ +Significance: patch +Type: dev + +Make eslint emit JSON report for annotating PRs. diff --git a/packages/js/explat/package.json b/packages/js/explat/package.json index e1768a5d5d6..6bd11158294 100644 --- a/packages/js/explat/package.json +++ b/packages/js/explat/package.json @@ -62,7 +62,7 @@ "clean": "pnpm exec rimraf tsconfig.tsbuildinfo build build-*", "build": "pnpm -w exec turbo run turbo:build --filter=$npm_package_name", "test": "pnpm -w exec turbo run turbo:test --filter=$npm_package_name", - "lint": "eslint src", + "lint": "eslint --output-file eslint_report.json --format json src", "start": "concurrently \"tsc --project tsconfig.json --watch\" \"tsc --project tsconfig-cjs.json --watch\"", "prepack": "pnpm run clean && pnpm run build", "lint:fix": "eslint src --fix", diff --git a/packages/js/internal-js-tests/package.json b/packages/js/internal-js-tests/package.json index 85de0c6a290..ca75ee29fe1 100644 --- a/packages/js/internal-js-tests/package.json +++ b/packages/js/internal-js-tests/package.json @@ -23,7 +23,7 @@ "scripts": { "turbo:build": "tsc --project tsconfig.json && tsc --project tsconfig-cjs.json", "build": "pnpm -w exec turbo run turbo:build --filter=$npm_package_name", - "lint": "eslint src", + "lint": "eslint --output-file eslint_report.json --format json src", "ts:check": "tsc --noEmit --project ./tsconfig.json", "clean": "pnpm exec rimraf *.tsbuildinfo build build-*", "prepack": "pnpm run clean && pnpm run build", diff --git a/packages/js/navigation/changelog/dev-include-eslint-annotations b/packages/js/navigation/changelog/dev-include-eslint-annotations new file mode 100644 index 00000000000..bded8d77ece --- /dev/null +++ b/packages/js/navigation/changelog/dev-include-eslint-annotations @@ -0,0 +1,4 @@ +Significance: patch +Type: dev + +Make eslint emit JSON report for annotating PRs. diff --git a/packages/js/navigation/package.json b/packages/js/navigation/package.json index bab8aad54f0..4f5f84da9ff 100644 --- a/packages/js/navigation/package.json +++ b/packages/js/navigation/package.json @@ -52,7 +52,7 @@ "clean": "pnpm exec rimraf tsconfig.tsbuildinfo build build-*", "build": "pnpm -w exec turbo run turbo:build --filter=$npm_package_name", "test": "pnpm -w exec turbo run turbo:test --filter=$npm_package_name", - "lint": "eslint src", + "lint": "eslint --output-file eslint_report.json --format json src", "start": "concurrently \"tsc --project tsconfig.json --watch\" \"tsc --project tsconfig-cjs.json --watch\"", "prepack": "pnpm run clean && pnpm run build", "lint:fix": "eslint src --fix", diff --git a/packages/js/notices/package.json b/packages/js/notices/package.json index 3012f5c7f77..33b30bbd671 100644 --- a/packages/js/notices/package.json +++ b/packages/js/notices/package.json @@ -44,7 +44,7 @@ "turbo:build": "tsc --project tsconfig.json && tsc --project tsconfig-cjs.json", "clean": "pnpm exec rimraf tsconfig.tsbuildinfo build build-*", "build": "pnpm -w exec turbo run turbo:build --filter=$npm_package_name", - "lint": "eslint src", + "lint": "eslint --output-file eslint_report.json --format json src", "start": "concurrently \"tsc --project tsconfig.json --watch\" \"tsc --project tsconfig-cjs.json --watch\"", "prepack": "pnpm run clean && pnpm run build", "lint:fix": "eslint src --fix" diff --git a/packages/js/number/changelog/dev-include-eslint-annotations b/packages/js/number/changelog/dev-include-eslint-annotations new file mode 100644 index 00000000000..bded8d77ece --- /dev/null +++ b/packages/js/number/changelog/dev-include-eslint-annotations @@ -0,0 +1,4 @@ +Significance: patch +Type: dev + +Make eslint emit JSON report for annotating PRs. diff --git a/packages/js/number/package.json b/packages/js/number/package.json index 6c29b368866..ea3ddffece2 100644 --- a/packages/js/number/package.json +++ b/packages/js/number/package.json @@ -38,7 +38,7 @@ "clean": "pnpm exec rimraf tsconfig.tsbuildinfo build build-*", "build": "pnpm -w exec turbo run turbo:build --filter=$npm_package_name", "test": "pnpm -w exec turbo run turbo:test --filter=$npm_package_name", - "lint": "eslint src", + "lint": "eslint --output-file eslint_report.json --format json src", "start": "concurrently \"tsc --project tsconfig.json --watch\" \"tsc --project tsconfig-cjs.json --watch\"", "prepack": "pnpm run clean && pnpm run build", "lint:fix": "eslint src --fix", diff --git a/packages/js/onboarding/changelog/dev-include-eslint-annotations b/packages/js/onboarding/changelog/dev-include-eslint-annotations new file mode 100644 index 00000000000..bded8d77ece --- /dev/null +++ b/packages/js/onboarding/changelog/dev-include-eslint-annotations @@ -0,0 +1,4 @@ +Significance: patch +Type: dev + +Make eslint emit JSON report for annotating PRs. diff --git a/packages/js/onboarding/package.json b/packages/js/onboarding/package.json index 2767b99c339..2ce5d3cdce4 100644 --- a/packages/js/onboarding/package.json +++ b/packages/js/onboarding/package.json @@ -71,7 +71,7 @@ "changelog": "composer exec -- changelogger", "clean": "pnpm exec rimraf tsconfig.tsbuildinfo build build-*", "build": "pnpm -w exec turbo run turbo:build --filter=$npm_package_name", - "lint": "eslint src", + "lint": "eslint --output-file eslint_report.json --format json src", "build:js": "tsc --project tsconfig.json && tsc --project tsconfig-cjs.json", "build:css": "webpack", "start": "concurrently \"tsc --project tsconfig.json --watch\" \"tsc --project tsconfig-cjs.json --watch\" \"webpack --watch\"", diff --git a/packages/js/product-editor/changelog/dev-include-eslint-annotations b/packages/js/product-editor/changelog/dev-include-eslint-annotations new file mode 100644 index 00000000000..bded8d77ece --- /dev/null +++ b/packages/js/product-editor/changelog/dev-include-eslint-annotations @@ -0,0 +1,4 @@ +Significance: patch +Type: dev + +Make eslint emit JSON report for annotating PRs. diff --git a/packages/js/product-editor/package.json b/packages/js/product-editor/package.json index 60ff7e69a2c..db087aa8469 100644 --- a/packages/js/product-editor/package.json +++ b/packages/js/product-editor/package.json @@ -121,7 +121,7 @@ "clean": "pnpm exec rimraf tsconfig.tsbuildinfo build build-*", "build": "pnpm -w exec turbo run turbo:build --filter=$npm_package_name", "test": "pnpm -w exec turbo run turbo:test --filter=$npm_package_name", - "lint": "eslint src", + "lint": "eslint --output-file eslint_report.json --format json src", "build:js": "tsc --project tsconfig.json && tsc --project tsconfig-cjs.json", "build:css": "webpack", "start": "concurrently \"tsc --project tsconfig.json --watch\" \"tsc --project tsconfig-cjs.json --watch\" \"webpack --watch\"", diff --git a/packages/js/tracks/changelog/dev-include-eslint-annotations b/packages/js/tracks/changelog/dev-include-eslint-annotations new file mode 100644 index 00000000000..bded8d77ece --- /dev/null +++ b/packages/js/tracks/changelog/dev-include-eslint-annotations @@ -0,0 +1,4 @@ +Significance: patch +Type: dev + +Make eslint emit JSON report for annotating PRs. diff --git a/packages/js/tracks/package.json b/packages/js/tracks/package.json index bd6f2bef82f..a3bde81297d 100644 --- a/packages/js/tracks/package.json +++ b/packages/js/tracks/package.json @@ -37,7 +37,7 @@ "changelog": "composer exec -- changelogger", "clean": "pnpm exec rimraf tsconfig.tsbuildinfo build build-*", "build": "pnpm -w exec turbo run turbo:build --filter=$npm_package_name", - "lint": "eslint src", + "lint": "eslint --output-file eslint_report.json --format json src", "start": "concurrently \"tsc --project tsconfig.json --watch\" \"tsc --project tsconfig-cjs.json --watch\"", "prepack": "pnpm run clean && pnpm run build", "lint:fix": "eslint src --fix"