Skip to content

TCA-499 eslint rules & fixes -> dev #414

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

Merged
merged 49 commits into from
Nov 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
fa24ed0
add eslint for typescript following airbnb style guide, react app, re…
vas3a Jul 14, 2022
0051c67
add prettier
vas3a Jul 14, 2022
b77b646
TCA-499 #comment This commit merges branch 'eslint-prettier' into TCA…
brooketopcoder Oct 17, 2022
cc8b277
Merge branch 'dev' into TCA-499_eslint
brooketopcoder Nov 7, 2022
acdfc58
TCA-561 #comment This commit updates the eslint rules to match our st…
brooketopcoder Nov 7, 2022
5d9d5a8
TCA-645 #comment This commit fixes all eslint issues that are auto-fi…
brooketopcoder Nov 7, 2022
fc56bb0
TCA-647 delete prettier
brooketopcoder Nov 7, 2022
e516391
Merge pull request #400 from topcoder-platform/TCA-561_eval-rules
brooketopcoder Nov 7, 2022
afc052c
Merge pull request #401 from topcoder-platform/TCA-645_auto-fix
brooketopcoder Nov 7, 2022
734c4a7
Merge branch 'TCA-499_eslint' into TCA-647_delete-prettier
brooketopcoder Nov 7, 2022
2b9b077
TCA-647 prettier rules
brooketopcoder Nov 7, 2022
03c640d
TCA-647 fix yarn lock
brooketopcoder Nov 8, 2022
46e431a
TCA-647 #comment This commit fixes all the auto-fixable lint errors t…
brooketopcoder Nov 8, 2022
8da0c84
TCA-647 #comment This commit updates rules so that we can remove tsli…
brooketopcoder Nov 8, 2022
b75eb48
TCA-647 clean up
brooketopcoder Nov 8, 2022
11c431b
TCA-647 clean up
brooketopcoder Nov 8, 2022
9b014a4
TCA-645 #comment This commit performs some lint fixes as examples #ti…
brooketopcoder Nov 8, 2022
436d99e
TCA-645 Fix bug #time 15m
brooketopcoder Nov 8, 2022
6de9429
TCA-647 clean up
brooketopcoder Nov 8, 2022
c1be9ba
Merge branch 'TCA-647_delete-prettier' into TCA-560_line-breaks
brooketopcoder Nov 8, 2022
4c736f1
TCA-560 #comment This commit fixes missing typedef rules and forces f…
brooketopcoder Nov 8, 2022
dd56bd7
TCA-645 clean up
brooketopcoder Nov 9, 2022
3ce8286
TCA-645 #comment This PR fixes a lint issue that i didn't understand …
brooketopcoder Nov 9, 2022
7479b16
Merge pull request #402 from topcoder-platform/TCA-647_delete-prettier
brooketopcoder Nov 9, 2022
b329c34
Merge pull request #403 from topcoder-platform/TCA-645_example-fixes
brooketopcoder Nov 9, 2022
254241c
TCA-560 #comment This commit reverts functions. sad #time 15m
brooketopcoder Nov 9, 2022
f27862e
TCA-550 clean up
brooketopcoder Nov 9, 2022
1a2e0ab
lint issues in src-ts/util
vas3a Nov 10, 2022
eb50c51
TCA-560 pr feedback
brooketopcoder Nov 10, 2022
820dcbb
fix lint errors for part of tools/learn
vas3a Nov 11, 2022
5d4be78
TCA-499 #comment This commit adds line breaks before chained methods …
brooketopcoder Nov 11, 2022
c845574
Merge branch 'dev' into TCA-499_eslint
brooketopcoder Nov 11, 2022
57fa621
Merge branch 'TCA-499_eslint' into TCA-499_eslint_fix-linting
brooketopcoder Nov 11, 2022
58c027d
TCA-499 fix param reassignment
brooketopcoder Nov 11, 2022
8fc61aa
Merge branch 'TCA-499_eslint_fix-linting' into TCA-499_break-chain
brooketopcoder Nov 11, 2022
7d9ef5e
TCA-499 auto fixes
brooketopcoder Nov 11, 2022
46a6b44
Merge pull request #411 from topcoder-platform/TCA-499_break-chain
brooketopcoder Nov 11, 2022
21f4512
PR feedback
vas3a Nov 14, 2022
8e084d1
TCA-499 clean up
brooketopcoder Nov 14, 2022
4744265
Merge branch 'TCA-499_eslint_fix-linting' of https://github.com/topco…
brooketopcoder Nov 14, 2022
afc6010
TCA-499 clean up
brooketopcoder Nov 14, 2022
aed04fc
Merge pull request #410 from topcoder-platform/TCA-499_eslint_fix-lin…
brooketopcoder Nov 14, 2022
1224d85
Merge branch 'TCA-499_eslint' into TCA-560_line-breaks
brooketopcoder Nov 14, 2022
f5b9823
Merge pull request #406 from topcoder-platform/TCA-560_line-breaks
brooketopcoder Nov 14, 2022
a48e287
TCA-499 #comment This commit disables the eslint job in CI #time 15m
brooketopcoder Nov 14, 2022
946a90e
Merge branch 'TCA-499_eslint' of https://github.com/topcoder-platform…
brooketopcoder Nov 14, 2022
8e409b0
Merge branch 'dev' into TCA-499_eslint
brooketopcoder Nov 14, 2022
03f2304
TCA-499 clean up
brooketopcoder Nov 14, 2022
5140cea
TCA-499 more clean up
brooketopcoder Nov 14, 2022
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
64 changes: 32 additions & 32 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ save_cache_settings: &save_cache_settings
paths:
- node_modules

running_yarn_tslint: &running_yarn_tslint
name: Running Yarn tslint
running_yarn_eslint: &running_yarn_eslint
name: Running Yarn eslint
command: |
yarn add tslint -g
yarn add eslint -g
yarn lint

running_yarn_build: &running_yarn_build
Expand Down Expand Up @@ -81,7 +81,7 @@ lint_steps: &lint_steps
# Initialization.
- checkout
- setup_remote_docker
- run: *running_yarn_tslint
- run: *running_yarn_eslint

build_steps: &build_steps
# Initialization.
Expand Down Expand Up @@ -129,21 +129,21 @@ deploy_steps: &deploy_steps
./master_deploy.sh -d CFRONT -e $DEPLOY_ENV -c $ENABLE_CACHE

jobs:
lint-dev:
<<: *defaults
environment:
DEPLOY_ENV: "DEV"
LOGICAL_ENV: "dev"
APPNAME: "platform-ui-mvp"
steps: *lint_steps

lint-prod:
<<: *defaults
environment:
DEPLOY_ENV: "PROD"
LOGICAL_ENV: "prod"
APPNAME: "platform-ui-mvp"
steps: *lint_steps
# lint-dev:
# <<: *defaults
# environment:
# DEPLOY_ENV: "DEV"
# LOGICAL_ENV: "dev"
# APPNAME: "platform-ui-mvp"
# steps: *lint_steps

# lint-prod:
# <<: *defaults
# environment:
# DEPLOY_ENV: "PROD"
# LOGICAL_ENV: "prod"
# APPNAME: "platform-ui-mvp"
# steps: *lint_steps

build-dev:
<<: *defaults
Expand Down Expand Up @@ -192,19 +192,19 @@ workflows:
version: 2
build:
jobs:
- lint-dev:
context : org-global
filters:
branches:
ignore:
- master

- lint-prod:
context : org-global
filters:
branches:
only:
- master
# - lint-dev:
# context : org-global
# filters:
# branches:
# ignore:
# - master

# - lint-prod:
# context : org-global
# filters:
# branches:
# only:
# - master

- build-dev:
context : org-global
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,3 @@ yarn-error.log*

# Editors
.editorconfig
.prettierrc
26 changes: 13 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,10 +190,12 @@ Each [Tool](#tools) can have its own setup requirements. Please see each tool's
| `yarn start:<dev>` | Serve dev mode build with dev's personal config |
| `yarn build` | Build dev mode build with the default config and outputs static files in /builds |
| `yarn build:prod` | Build prod mode build with the prod config and outputs static files in /builds |
| `yarn lint` | Run tslint against ts/x files and outputs report |
| `yarn lint:fix` | Run tslint against ts/x files, fixes auto-fixable issues, and outputs report |
| `yarn eslint` | Run eslint against js/x files and outputs report |
| `yarn eslint:fix` | Run eslint against js/x files, fixes auto-fixable issues, and outputs report |
| `yarn lint:ts` | Run eslint against ts/x files and outputs report |
| `yarn lint:ts:fix` | Run eslint against ts/x files, fixes auto-fixable issues, and outputs report |
| `yarn lint:js` | Run eslint against js/x files and outputs report |
| `yarn lint:js:fix` | Run eslint against js/x files, fixes auto-fixable issues, and outputs report |
| `yarn lint` | Run eslint against js/x and ts/x files and outputs report |
| `yarn lint:fix` | Run eslint against js/x and ts/x files, fixes auto-fixable issues, and outputs report |
| `yarn test` | Run unit tests, watching for changes and re-running per your specifications |
| `yarn test:no-watch` | Run unit tests once, without watching for changes or re-running |
| `yarn cy:run` | Run e2e tests once in local command with the site is running |
Expand Down Expand Up @@ -370,11 +372,11 @@ The PlatformRoute model has several useful options:
## Linting

### Rules
While [TSLint](https://palantir.github.io/tslint/) is technically deprecated in favor of [Typescript ESLint](https://typescript-eslint.io/), TSLint is still far better at linting Typescript files than ESLint. So, for the time being, TSLint will be the primary linter, but ESLint remains configured for JS/X files.

The following command will install TSLint globally:
Javascript rules: [src/.eslintrc.js](src/.eslintrc.js)

Typescript rules: [src-ts/.eslintrc.js](src-ts/.eslintrc.js)

>% yarn global add tslint typescript

### Command Line

Expand All @@ -386,9 +388,7 @@ The following command will install TSLint globally:

>% yarn lint:fix

OR

>% yarn eslint:fix
See the [yarn commmands](#yarn-commands) for further options.

### VS Code

Expand All @@ -411,16 +411,16 @@ The most useful feature is to automatically apply all lint rules any time you sa
...
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll.tslint": true,
"source.fixAll.eslint": true,
},
}
```

#### TSLint Plugin
#### ESLint Plugin

Created by Microsoft, this plugin will allow you to see lint errors in the Problems panel.

>**WARNING:** Other lint plugins can interfere with TSLint, so it is recommended that you uninstall/disable all other lint plugins (e.g. ESLint, Prettier, etc).
>**WARNING:** Other lint plugins can interfere with ESLint, so it is recommended that you uninstall/disable all other lint plugins (e.g. TSLint, Prettier, etc).

## Styling

Expand Down
1 change: 0 additions & 1 deletion cypress.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// tslint:disable-next-line: no-submodule-imports This is the way cypress does it
import task from '@cypress/code-coverage/task'
import { defineConfig } from 'cypress'

Expand Down
36 changes: 22 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
"start": "sh start-ssl.sh",
"start:brooke": "sudo sh start-ssl-brooke.sh",
"build": "yarn react-app-rewired build",
"lint": "tslint 'src-ts/**/*.{ts,tsx}' && eslint 'src*/**/*.{js,jsx,ts,tsx}'",
"lint:fix": "tslint 'src-ts/**/*.{ts,tsx}' --fix && eslint 'src*/**/*.{js,jsx,ts,tsx}' --fix",
"tslint": "tslint 'src-ts/**/*.{ts,tsx}'",
"tslint:fix": "tslint 'src-ts/**/*.{ts,tsx}' --fix",
"eslint": "eslint 'src/**/*.{js,jsx}'",
"eslint:fix": "eslint 'src/**/*.{js,jsx}' --fix",
"lint:ts": "eslint -c ./src-ts/.eslintrc.js 'src-ts/**/*.{ts,tsx}'",
"lint:ts:fix": "eslint -c ./src-ts/.eslintrc.js 'src-ts/**/*.{ts,tsx}' --fix",
"lint:js": "eslint -c ./src/.eslintrc.js 'src/**/*.{js,jsx}'",
"lint:js:fix": "eslint -c ./src/.eslintrc.js 'src/**/*.{js,jsx}' --fix",
"lint": "npm run lint:js && npm run lint:ts",
"lint:fix": "npm run lint:js:fix && npm run lint:ts:fix",
"test": "react-scripts test --watchAll",
"test:no-watch": "react-scripts test --watchAll=false --passWithNoTests",
"cy:run": "cypress run --reporter junit",
Expand All @@ -23,6 +23,8 @@
"dependencies": {
"@datadog/browser-logs": "^4.21.2",
"@heroicons/react": "^1.0.6",
"@stripe/react-stripe-js": "1.13.0",
"@stripe/stripe-js": "1.41.0",
"apexcharts": "^3.36.0",
"axios": "^1.1.2",
"browser-cookies": "^1.2.0",
Expand Down Expand Up @@ -78,8 +80,6 @@
"@babel/preset-typescript": "^7.18.6",
"@babel/runtime": "^7.19.4",
"@cypress/code-coverage": "^3.10.0",
"@stripe/react-stripe-js": "1.13.0",
"@stripe/stripe-js": "1.41.0",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^14.4.3",
Expand All @@ -102,6 +102,8 @@
"@types/segment-analytics": "^0.0.34",
"@types/systemjs": "^6.1.1",
"@types/uuid": "^8.3.4",
"@typescript-eslint/eslint-plugin": "^5.30.6",
"@typescript-eslint/parser": "^5.30.6",
"@wdio/junit-reporter": "^7.25.1",
"autoprefixer": "^10.4.12",
"babel-eslint": "^11.0.0-beta.2",
Expand All @@ -114,11 +116,17 @@
"cross-env": "^7.0.3",
"cypress": "^10.10.0",
"eslint": "^8.25.0",
"eslint-config-prettier": "^8.5.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-config-react-app": "^7.0.1",
"eslint-config-react-important-stuff": "^3.0.0",
"eslint-import-resolver-typescript": "^3.2.5",
"eslint-plugin-cypress": "^2.12.1",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-import": "^2.25.3",
"eslint-plugin-jsx-a11y": "^6.5.1",
"eslint-plugin-no-null": "^1.0.2",
"eslint-plugin-ordered-imports": "^0.6.0",
"eslint-plugin-react": "^7.28.0",
"eslint-plugin-react-hooks": "^4.3.0",
"file-loader": "^6.2.0",
"husky": "^8.0.1",
"identity-obj-proxy": "^3.0.0",
Expand All @@ -127,17 +135,17 @@
"jest-cli": "^29.2.0",
"lint-staged": "^13.0.3",
"nyc": "^15.1.0",
"postcss-loader": "^7.0.1",
"postcss-scss": "^4.0.5",
"prettier": "^2.7.1",
"postcss-loader": "^4.0.4",
"postcss-scss": "^3.0.2",
"pretty-quick": "^3.1.3",
"resolve-url-loader": "^5.0.0",
"sass-loader": "^13.1.0",
"serve": "^14.0.1",
"start-server-and-test": "^1.14.0",
"style-loader": "^3.3.1",
"systemjs-webpack-interop": "^2.3.7",
"tslint": "^6.1.3",
"typed-scss-modules": "^7.0.1",
"webpack": "^4.41.2",
"webpack-cli": "^4.10.0",
"webpack-config-single-spa-react": "^4.0.3",
"webpack-dev-server": "^4.11.1",
Expand Down
Loading