mirror of https://github.com/apache/superset.git
chore: improve/decouple eslint and tsc 'npm run' commands (#26704)
This commit is contained in:
parent
7c2093c495
commit
0f590799b2
|
@ -39,11 +39,20 @@ jobs:
|
||||||
uses: ./.github/actions/cached-dependencies
|
uses: ./.github/actions/cached-dependencies
|
||||||
with:
|
with:
|
||||||
run: npm-install
|
run: npm-install
|
||||||
- name: lint
|
- name: eslint
|
||||||
|
if: steps.check.outcome == 'failure'
|
||||||
|
working-directory: ./superset-frontend
|
||||||
|
run: |
|
||||||
|
npm run eslint -- . --quiet
|
||||||
|
- name: tsc
|
||||||
|
if: steps.check.outcome == 'failure'
|
||||||
|
working-directory: ./superset-frontend
|
||||||
|
run: |
|
||||||
|
npm run type
|
||||||
|
- name: prettier
|
||||||
if: steps.check.outcome == 'failure'
|
if: steps.check.outcome == 'failure'
|
||||||
working-directory: ./superset-frontend
|
working-directory: ./superset-frontend
|
||||||
run: |
|
run: |
|
||||||
npm run lint -- --quiet
|
|
||||||
npm run prettier-check
|
npm run prettier-check
|
||||||
- name: Build plugins packages
|
- name: Build plugins packages
|
||||||
if: steps.check.outcome == 'failure'
|
if: steps.check.outcome == 'failure'
|
||||||
|
|
|
@ -21,9 +21,12 @@ jobs:
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
working-directory: ./superset-websocket
|
working-directory: ./superset-websocket
|
||||||
run: npm ci
|
run: npm ci
|
||||||
- name: lint
|
- name: eslint
|
||||||
working-directory: ./superset-websocket
|
working-directory: ./superset-websocket
|
||||||
run: npm run lint
|
run: npm run eslint -- .
|
||||||
|
- name: typescript checks
|
||||||
|
working-directory: ./superset-websocket
|
||||||
|
run: npm run type
|
||||||
- name: prettier
|
- name: prettier
|
||||||
working-directory: ./superset-websocket
|
working-directory: ./superset-websocket
|
||||||
run: npm run prettier-check
|
run: npm run prettier-check
|
||||||
|
|
|
@ -788,7 +788,10 @@ is configured as a pre-commit hook. There are also numerous [editor integrations
|
||||||
```bash
|
```bash
|
||||||
cd superset-frontend
|
cd superset-frontend
|
||||||
npm ci
|
npm ci
|
||||||
npm run lint
|
# run eslint checks
|
||||||
|
npm run eslint -- .
|
||||||
|
# run tsc (typescript) checks
|
||||||
|
npm run type
|
||||||
```
|
```
|
||||||
|
|
||||||
If using the eslint extension with vscode, put the following in your workspace `settings.json` file:
|
If using the eslint extension with vscode, put the following in your workspace `settings.json` file:
|
||||||
|
|
|
@ -49,7 +49,10 @@ is configured as a pre-commit hook. There are also numerous [editor integrations
|
||||||
```bash
|
```bash
|
||||||
cd superset-frontend
|
cd superset-frontend
|
||||||
npm ci
|
npm ci
|
||||||
npm run lint
|
# run eslint checks
|
||||||
|
npm run eslint -- .
|
||||||
|
# run tsc (typescript) checks
|
||||||
|
npm run type
|
||||||
```
|
```
|
||||||
|
|
||||||
If using the eslint extension with vscode, put the following in your workspace `settings.json` file:
|
If using the eslint extension with vscode, put the following in your workspace `settings.json` file:
|
||||||
|
|
|
@ -20,6 +20,7 @@ cd "$(dirname "$0")"
|
||||||
npm --version
|
npm --version
|
||||||
node --version
|
node --version
|
||||||
time npm ci
|
time npm ci
|
||||||
time npm run lint
|
time npm run eslint -- .
|
||||||
|
time npm run check
|
||||||
time npm run cover # this also runs the tests, so no need to 'npm run test'
|
time npm run cover # this also runs the tests, so no need to 'npm run test'
|
||||||
time npm run build
|
time npm run build
|
||||||
|
|
|
@ -37,7 +37,6 @@
|
||||||
"src/setup/*"
|
"src/setup/*"
|
||||||
],
|
],
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"_lint": "eslint --ignore-path=.eslintignore --ext .js,.jsx,.ts,tsx .",
|
|
||||||
"_prettier": "prettier './({src,spec,cypress-base,plugins,packages,.storybook}/**/*{.js,.jsx,.ts,.tsx,.css,.less,.scss,.sass}|package.json)'",
|
"_prettier": "prettier './({src,spec,cypress-base,plugins,packages,.storybook}/**/*{.js,.jsx,.ts,.tsx,.css,.less,.scss,.sass}|package.json)'",
|
||||||
"build": "cross-env NODE_OPTIONS=--max_old_space_size=8192 NODE_ENV=production BABEL_ENV=\"${BABEL_ENV:=production}\" webpack --mode=production --color",
|
"build": "cross-env NODE_OPTIONS=--max_old_space_size=8192 NODE_ENV=production BABEL_ENV=\"${BABEL_ENV:=production}\" webpack --mode=production --color",
|
||||||
"build-dev": "cross-env NODE_OPTIONS=--max_old_space_size=8192 NODE_ENV=development webpack --mode=development --color",
|
"build-dev": "cross-env NODE_OPTIONS=--max_old_space_size=8192 NODE_ENV=development webpack --mode=development --color",
|
||||||
|
@ -50,9 +49,10 @@
|
||||||
"cover": "cross-env NODE_ENV=test jest --coverage",
|
"cover": "cross-env NODE_ENV=test jest --coverage",
|
||||||
"dev": "webpack --mode=development --color --watch",
|
"dev": "webpack --mode=development --color --watch",
|
||||||
"dev-server": "cross-env NODE_ENV=development BABEL_ENV=development node --max_old_space_size=4096 ./node_modules/webpack-dev-server/bin/webpack-dev-server.js --mode=development",
|
"dev-server": "cross-env NODE_ENV=development BABEL_ENV=development node --max_old_space_size=4096 ./node_modules/webpack-dev-server/bin/webpack-dev-server.js --mode=development",
|
||||||
|
"eslint": "eslint --ignore-path=.eslintignore --ext .js,.jsx,.ts,tsx",
|
||||||
"format": "npm run _prettier -- --write",
|
"format": "npm run _prettier -- --write",
|
||||||
"lint": "npm run _lint && npm run type",
|
"lint": "npm run eslint -- . && npm run type",
|
||||||
"lint-fix": "npm run _lint -- --fix && npm run type",
|
"lint-fix": "npm run eslint -- . --fix",
|
||||||
"plugins:build": "node ./scripts/build.js",
|
"plugins:build": "node ./scripts/build.js",
|
||||||
"plugins:build-assets": "node ./scripts/copyAssets.js",
|
"plugins:build-assets": "node ./scripts/copyAssets.js",
|
||||||
"plugins:build-storybook": "cd packages/superset-ui-demo && npm run build-storybook",
|
"plugins:build-storybook": "cd packages/superset-ui-demo && npm run build-storybook",
|
||||||
|
|
|
@ -106,7 +106,7 @@ function getPackages(packagePattern, tsOnly = false) {
|
||||||
let scope = getPackages(glob);
|
let scope = getPackages(glob);
|
||||||
|
|
||||||
if (shouldLint) {
|
if (shouldLint) {
|
||||||
run(`npm run lint --fix {packages,plugins}/${scope}/{src,test}`);
|
run(`npm run eslint -- . --fix {packages,plugins}/${scope}/{src,test}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (shouldCleanup) {
|
if (shouldCleanup) {
|
||||||
|
|
Loading…
Reference in New Issue