Skip to content

Commit 9ed96a1

Browse files
authoredApr 27, 2023
fix(linter): do not replace legacy package in binary files (#16617)
1 parent 68f019e commit 9ed96a1

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed
 

‎packages/eslint-plugin/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.ts

+5
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { Tree, formatFiles, visitNotIgnoredFiles } from '@nx/devkit';
22
import { replaceNrwlPackageWithNxPackage } from '@nx/devkit/src/utils/replace-package';
33

44
import { basename } from 'path';
5+
import { isBinaryPath } from '@nx/devkit/src/utils/binary-extensions';
56

67
const eslintFileNames = [
78
'.eslintrc',
@@ -28,6 +29,10 @@ export default async function replacePackage(tree: Tree): Promise<void> {
2829
*/
2930
const ignoreLineRegex = /(eslint-disable(?:(?:-next)?-line)?\s*)@nrwl\/nx/g;
3031
visitNotIgnoredFiles(tree, '.', (path) => {
32+
if (isBinaryPath(path)) {
33+
return;
34+
}
35+
3136
let contents = tree.read(path).toString();
3237
if (eslintFileNames.includes(basename(path))) {
3338
if (!contents.includes('@nrwl/nx')) {

1 commit comments

Comments
 (1)

vercel[bot] commented on Apr 27, 2023

@vercel[bot]

Successfully deployed to the following URLs:

nx-dev – ./

nx-dev-git-master-nrwl.vercel.app
nx-dev-nrwl.vercel.app
nx-five.vercel.app
nx.dev

Please sign in to comment.