-
Notifications
You must be signed in to change notification settings - Fork 37
chore: Add ESLint 7 support #39
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,9 @@ | ||
| version: 2 | ||
| version: 2.1 | ||
|
|
||
| jobs: | ||
| build: | ||
| docker: | ||
| - image: circleci/node:10 | ||
| - image: circleci/node | ||
|
|
||
| steps: | ||
| - checkout | ||
|
|
@@ -11,13 +12,45 @@ jobs: | |
| keys: | ||
| - v1-dependencies-{{ checksum "yarn.lock" }} | ||
| - v1-dependencies- | ||
|
|
||
| - run: yarn install --frozen-lock | ||
|
|
||
| - save_cache: | ||
| paths: | ||
| - node_modules | ||
| key: v1-dependencies-{{ checksum "yarn.lock" }} | ||
|
|
||
| - run: yarn format:check | ||
| - run: yarn lint | ||
| - run: yarn test | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just to confirm, from the compatibility perspective, we're more interested in the test results because
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, you are right. |
||
|
|
||
| test_eslint: | ||
| docker: | ||
| - image: circleci/node | ||
|
|
||
| parameters: | ||
| eslint: | ||
| type: string | ||
|
|
||
| steps: | ||
| - checkout | ||
|
|
||
| - restore_cache: | ||
| keys: | ||
| - v1-dependencies-{{ checksum "yarn.lock" }} | ||
| - v1-dependencies- | ||
|
|
||
| - run: yarn format -- --list-different | ||
| - run: yarn install --frozen-lock | ||
| - run: yarn add --dev eslint@<< parameters.eslint >> | ||
| - run: yarn test | ||
|
|
||
| workflows: | ||
| build_and_test: | ||
| jobs: | ||
| - build | ||
| - test_eslint: | ||
| requires: | ||
| - build | ||
| matrix: | ||
| parameters: | ||
| eslint: ["6", "7"] | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -12,25 +12,26 @@ | |||||
| ], | ||||||
| "scripts": { | ||||||
| "format": "prettier --write \"**/*.{js,md}\"", | ||||||
| "format:check": "prettier --check \"**/*.{js,md}\"", | ||||||
| "lint": "eslint", | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Seems like eslint@6 just prints the help options when you don't specify a path: But eslint@7 is fine without it:
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good catch @ekashida. I think we need to run |
||||||
| "test": "mocha" | ||||||
| }, | ||||||
| "dependencies": { | ||||||
| "@lwc/eslint-plugin-lwc": "~0.10.0", | ||||||
| "babel-eslint": "~10.1.0", | ||||||
| "eslint-plugin-import": "~2.20.2", | ||||||
| "eslint-plugin-import": "~2.22.1", | ||||||
| "eslint-plugin-jest": "~23.8.2", | ||||||
| "eslint-restricted-globals": "~0.2.0" | ||||||
| }, | ||||||
| "devDependencies": { | ||||||
| "eslint": "^6.8.0", | ||||||
| "husky": "^4.2.5", | ||||||
| "lint-staged": "^10.1.6", | ||||||
| "mocha": "^7.1.1", | ||||||
| "prettier": "^2.0.4" | ||||||
| "eslint": "^7.13.0", | ||||||
| "husky": "^4.3.0", | ||||||
| "lint-staged": "^10.5.1", | ||||||
| "mocha": "^8.2.1", | ||||||
| "prettier": "^2.1.2" | ||||||
| }, | ||||||
| "peerDependencies": { | ||||||
| "eslint": "^6.0.0" | ||||||
| "eslint": "^6 || ^7" | ||||||
| }, | ||||||
| "repository": { | ||||||
| "type": "git", | ||||||
|
|
@@ -48,7 +49,7 @@ | |||||
| ], | ||||||
| "husky": { | ||||||
| "hooks": { | ||||||
| "pre-commit": "lint-staged && yarn format" | ||||||
| "pre-commit": "lint-staged" | ||||||
| } | ||||||
| }, | ||||||
| "lint-staged": { | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this cache key used for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We make CircleCI cache the NPM dependencies between builds so we don't have to redownload them.
Based on your other comments, I will rework the CI config.