Skip to content

chore: using eslint instead of tslint #584

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 1 commit into from
Mar 26, 2021
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
13 changes: 13 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# from .gitignore
node_modules/
coverage/
dist/
.idea
.cache
*.tgz
.DS_Store
esm
esnext

# custom ignore pattern
*.html
50 changes: 50 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"plugins": ["@typescript-eslint"],
"parser": "@typescript-eslint/parser",
"extends": [
"plugin:react/recommended",
"plugin:@typescript-eslint/recommended",
"prettier"
],
"globals": {
"Atomics": "readonly",
"SharedArrayBuffer": "readonly"
},
"rules": {
"@typescript-eslint/explicit-member-accessibility": [
"error",
{
"accessibility": "no-public",
"overrides": {
"parameterProperties": "explicit"
}
}
],
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-parameter-properties": "off",
"@typescript-eslint/no-use-before-define": ["error", { "functions": false, "classes": false }],
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-var-requires": "off",
"@typescript-eslint/ban-ts-comment": "off",
"no-console": ["error", { "allow": ["warn", "error"] }]
},
"settings": {
"react": {
"version": "detect"
}
},
"env": {
"browser": true,
"es6": true
},
"parserOptions": {
"project": "./tsconfig.json",
"extraFileExtensions": [".html"],
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": 2018,
"sourceType": "module"
}
}
22 changes: 12 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@
"build": "yarn build:esm && yarn build:cjs",
"build:esm": "rm -rf dist/esm && tsc -p src/tsconfig.json --module es2015 --target es5 --outDir dist/esm",
"build:cjs": "rm -rf dist/cjs && tsc -p src/tsconfig.json --module commonjs --target es5 --outDir dist/cjs",
"lint": "tslint -c tslint.json -p src/tsconfig.json",
"start": "webpack-dev-server --config ./tools/webpack.config.js --progress --color",
"test": "NODE_ENV=test jest --no-cache --ci"
"test": "NODE_ENV=test jest --no-cache --ci",
"lint": "yarn lint:eslint && yarn lint:tsc",
"lint:eslint": "eslint . --ext .ts,.tsx --fix --max-warnings 0",
"lint:tsc": "tsc -p ./tsconfig.json --noEmit"
},
"repository": {
"type": "git",
Expand All @@ -28,8 +30,13 @@
"@types/sinon": "^9.0.0",
"@types/sinon-chai": "^3.2.3",
"@types/webpack": "^4.41.0",
"@typescript-eslint/eslint-plugin": "^4.19.0",
"@typescript-eslint/parser": "^4.19.0",
"browser-resolve": "^2.0.0",
"codecov": "^3.6.1",
"eslint": "^7.22.0",
"eslint-config-prettier": "^8.1.0",
"eslint-plugin-react": "^7.23.1",
"fork-ts-checker-webpack-plugin": "^6.0.0",
"happypack": "^5.0.1",
"html-webpack-plugin": "^5.0.0",
Expand All @@ -46,18 +53,13 @@
"standard": "^16.0.0",
"ts-jest": "^26.0.0",
"ts-loader": "^8.0.0",
"tslint": "^5.20.1",
"tslint-config-prettier": "^1.18.0",
"tslint-eslint-rules": "^5.4.0",
"tslint-react": "^4.1.0",
"tslint-sonarts": "^1.9.0",
"typescript": "^3.7.3",
"typescript": "^4.2.0",
"webpack": "^5.0.0",
"webpack-cli": "^4.0.0",
"webpack-dev-server": "^3.9.0"
},
"dependencies": {
"tslib": "^2.0.0",
"tslib": "^2.1.0",
"use-constant": "^1.0.0"
},
"lint-staged": {
Expand All @@ -67,7 +69,7 @@
],
"*.@(ts|tsx)": [
"prettier --write",
"tslint -c tslint.json --fix"
"yarn lint:eslint"
]
},
"prettier": {
Expand Down
2 changes: 1 addition & 1 deletion src/__test__/find.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ReactTestInstance } from 'react-test-renderer'

export function find(node: ReactTestInstance, type: string) {
export function find(node: ReactTestInstance, type: string): ReactTestInstance {
return node.find((node) => node.type === type)
}
4 changes: 2 additions & 2 deletions src/__test__/use-event-callback.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ describe('useEventCallback specs', () => {
const factory = (event$: Observable<React.MouseEvent<HTMLButtonElement>>, state$: Observable<number>) =>
event$.pipe(
withLatestFrom(state$),
map(([_, state]) => {
map(([, state]) => {
return state + value
}),
delay(timeToDelay),
Expand Down Expand Up @@ -130,7 +130,7 @@ describe('useEventCallback specs', () => {
): Observable<number> =>
event$.pipe(
combineLatest(inputs$),
map(([_, [count]]) => {
map(([, [count]]) => {
return value + count
}),
delay(timeToDelay),
Expand Down
63 changes: 0 additions & 63 deletions tslint.json

This file was deleted.

Loading