From 8c0d7bed49d669b93741886d807999a21f732eb4 Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Wed, 6 Jul 2022 19:45:02 +0200 Subject: [PATCH] only show errors in lint output, scrolling past 10000 warnings isn't helping --- lib/ui/package.json | 1 + lib/ui/scripts/generate-exports-file.ts | 16 +++++----------- package.json | 2 +- yarn.lock | 1 + 4 files changed, 8 insertions(+), 12 deletions(-) diff --git a/lib/ui/package.json b/lib/ui/package.json index db3ce7dfec2f..6c4348f6307e 100644 --- a/lib/ui/package.json +++ b/lib/ui/package.json @@ -87,6 +87,7 @@ "react-helmet-async": "^1.0.7", "react-sizeme": "^3.0.1", "resolve-from": "^5.0.0", + "shelljs": "^0.8.5", "store2": "^2.12.0", "ts-dedent": "^2.0.0", "typescript": "~4.6.3", diff --git a/lib/ui/scripts/generate-exports-file.ts b/lib/ui/scripts/generate-exports-file.ts index b0306bd79546..61768f82e47b 100644 --- a/lib/ui/scripts/generate-exports-file.ts +++ b/lib/ui/scripts/generate-exports-file.ts @@ -1,8 +1,7 @@ -/* eslint-disable camelcase */ /* eslint-disable no-console */ import fs from 'fs-extra'; import path from 'path'; -import child_process from 'child_process'; +import shelljs from 'shelljs'; import { dedent } from 'ts-dedent'; const remove = (regex?: RegExp) => (input: string) => @@ -30,15 +29,10 @@ const run = async () => { ); console.log('Linting...'); - child_process.exec( - `yarn lint:js:cmd --fix ${location}`, - { - cwd: path.join(__dirname, '..', '..', '..'), - }, - () => { - console.log('Done!'); - } - ); + shelljs.exec(`yarn lint:js:cmd --fix ${location}`, { + cwd: path.join(__dirname, '..', '..', '..'), + }); + console.log('Done!'); }; run().catch((e) => { diff --git a/package.json b/package.json index abc2f5ed4276..380bc073ae15 100644 --- a/package.json +++ b/package.json @@ -67,7 +67,7 @@ "linear-export": "ts-node --project=./scripts/tsconfig.json ./scripts/linear-export.ts", "lint": "yarn lint:js && yarn lint:md", "lint:ejs": "ejslint **/*.ejs", - "lint:js": "yarn lint:js:cmd .", + "lint:js": "yarn lint:js:cmd . --quiet", "lint:js:cmd": "cross-env NODE_ENV=production eslint --cache --cache-location=.cache/eslint --ext .js,.jsx,.json,.html,.ts,.tsx,.mjs --report-unused-disable-directives", "lint:md": "remark -q .", "lint:package": "sort-package-json", diff --git a/yarn.lock b/yarn.lock index 05a3831eba0e..0da01c4851ba 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9877,6 +9877,7 @@ __metadata: react-helmet-async: ^1.0.7 react-sizeme: ^3.0.1 resolve-from: ^5.0.0 + shelljs: ^0.8.5 store2: ^2.12.0 ts-dedent: ^2.0.0 typescript: ~4.6.3