Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Future - improve linting a bit #18642

Merged
merged 1 commit into from
Jul 6, 2022
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
1 change: 1 addition & 0 deletions lib/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
16 changes: 5 additions & 11 deletions lib/ui/scripts/generate-exports-file.ts
Original file line number Diff line number Diff line change
@@ -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) =>
Expand Down Expand Up @@ -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!');
}
);
Comment on lines -33 to -41
Copy link
Member Author

Choose a reason for hiding this comment

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

This wasn't awaited, so could be stopped mid-process if build failed

shelljs.exec(`yarn lint:js:cmd --fix ${location}`, {
cwd: path.join(__dirname, '..', '..', '..'),
});
console.log('Done!');
};

run().catch((e) => {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down