Skip to content

Commit

Permalink
chore(lint): switch from tslint to eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
wyze authored and plouc committed Nov 9, 2020
1 parent cbb9e37 commit 10642f1
Show file tree
Hide file tree
Showing 5 changed files with 3,243 additions and 2,417 deletions.
32 changes: 14 additions & 18 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,19 @@
parser: babel-eslint

parserOptions:
ecmaVersion: 6
sourceType: module
ecmaFeatures:
jsx: true
experimentalObjectRestSpread: true

env:
browser: true
es6: true

globals:
global: true

extends:
- react-app
- eslint:recommended
- plugin:react/recommended
- plugin:@typescript-eslint/recommended
- prettier
- prettier/@typescript-eslint

rules:
# Leave this as a warning while we convert the codebase, then remove it
'@typescript-eslint/ban-ts-comment': 'warn'
'@typescript-eslint/explicit-module-boundary-types': 'off'
'@typescript-eslint/no-empty-interface': 'warn'
'@typescript-eslint/no-empty-function': 'warn'
'@typescript-eslint/no-use-before-define': 'warn'
'no-use-before-define': 'off'

settings:
react:
version: detect
version: detect
2 changes: 0 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,5 @@ jobs:
- run: yarn install --frozen-lockfile
- run: make bootstrap
- run: make packages-build
- run: make fmt-check
- run: make packages-lint
- run: make packages-tslint
- run: make packages-test
32 changes: 1 addition & 31 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -117,37 +117,7 @@ package-lint-%: ##@1 packages run eslint on package

packages-lint: ##@1 packages run eslint on all packages
@echo "${YELLOW}Running eslint on all packages${RESET}"
@./node_modules/.bin/eslint "./packages/*/{src,tests}/**/*.js"

package-tslint-%: ##@1 packages run tslint on package
@echo "${YELLOW}Running tslint on package ${WHITE}@nivo/${*}${RESET}"
@./node_modules/.bin/tslint ./packages/${*}/index.d.ts

packages-tslint: ##@1 packages run tslint on all packages
@echo "${YELLOW}Running tslint on all packages${RESET}"
@./node_modules/.bin/tslint \
./packages/annotations/index.d.ts \
./packages/axes/index.d.ts \
./packages/bar/index.d.ts \
./packages/calendar/index.d.ts \
./packages/chord/index.d.ts \
./packages/colors/index.d.ts \
./packages/core/index.d.ts \
./packages/geo/index.d.ts \
./packages/heatmap/index.d.ts \
./packages/legends/index.d.ts \
./packages/line/index.d.ts \
./packages/network/index.d.ts \
./packages/pie/**/*.ts \
./packages/pie/**/*.tsx \
./packages/radar/index.d.ts \
./packages/sankey/index.d.ts \
./packages/scales/index.d.ts \
./packages/scatterplot/index.d.ts \
./packages/stream/index.d.ts \
./packages/swarmplot/index.d.ts \
./packages/waffle/index.d.ts \
./packages/voronoi/index.d.ts
@./node_modules/.bin/eslint "./packages/*/{src,tests}/**/*.{js,ts,tsx}"

package-test-cover-%: ##@1 packages run tests for a package with code coverage
@yarn jest -c ./packages/jest.config.js --rootDir . --coverage ./packages/${*}/tests
Expand Down
13 changes: 10 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
"@storybook/theming": "^6.0.26",
"@types/lodash": "^4.14.149",
"@types/react": "^16.9.16",
"@typescript-eslint/eslint-plugin": "^4.6.1",
"@typescript-eslint/parser": "^4.6.1",
"babel-eslint": "^10.1.0",
"babel-jest": "^24.9.0",
"babel-loader": "^8.1.0",
Expand All @@ -43,8 +45,14 @@
"core-js": "^3.0.1",
"enzyme": "^3.10.0",
"enzyme-adapter-react-16": "^1.15.1",
"eslint": "^7.3.0",
"eslint-plugin-react": "^7.20.0",
"eslint": "^7.13.0",
"eslint-config-prettier": "^6.15.0",
"eslint-config-react-app": "^6.0.0",
"eslint-plugin-flowtype": "^5.2.0",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-jsx-a11y": "^6.4.1",
"eslint-plugin-react": "^7.21.5",
"eslint-plugin-react-hooks": "^4.2.0",
"gh-pages": "^1.0.0",
"jest": "^26.0.1",
"jsdom": "^16.2.2",
Expand All @@ -64,7 +72,6 @@
"rollup-plugin-strip-banner": "^2.0.0",
"rollup-plugin-visualizer": "^4.2.0",
"serve": "^11.2.0",
"tslint": "^6.1.3",
"typescript": "^4.0.5"
},
"resolutions": {
Expand Down
Loading

0 comments on commit 10642f1

Please sign in to comment.