Skip to content
This repository was archived by the owner on Mar 4, 2020. It is now read-only.

Commit be899a8

Browse files
levithomasonlayershifter
authored andcommitted
chore: replace ts-lint with eslint
1 parent fc0d558 commit be899a8

File tree

12 files changed

+278
-260
lines changed

12 files changed

+278
-260
lines changed

.eslintignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.awcache/
2+
coverage/
3+
dist/
4+
dll/
5+
node_modules/

.eslintrc.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"extends": ["airbnb", "plugin:prettier/recommended"],
3+
"parser": "typescript-eslint-parser",
4+
"plugins": ["import", "prettier"],
5+
"env": {
6+
"browser": true
7+
},
8+
"rules": {
9+
"import/no-extraneous-dependencies": "off",
10+
"prettier/prettier": "error",
11+
"semi": ["error", "never"]
12+
}
13+
}

.prettierignore

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,11 @@
1-
.github/
2-
31
# editor configs
42
.idea/
53
.vscode/
64

75

86
coverage/
9-
107
dist/
118
dll/
12-
docs/src/componentInfo
13-
docs/src/componentMenu.json
14-
docs/src/behaviorMenu.json
15-
docs/src/exampleMenus
16-
docs/dist/
179
stats/
1810

1911
package.json

.prettierrc.json

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,8 @@
22
"$schema": "http://json.schemastore.org/prettierrc",
33
"htmlWhitespaceSensitivity": "ignore",
44
"printWidth": 100,
5-
"tabWidth": 2,
65
"semi": false,
76
"singleQuote": true,
87
"trailingComma": "all",
9-
"overrides": [
10-
{
11-
"files": ".prettierrc",
12-
"options": {
13-
"parser": "json"
14-
}
15-
}
16-
]
8+
"tabWidth": 2
179
}

build/gulp/plugins/util/parseType.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const _ = require('lodash')
22

3-
const evalValue = value => eval(value) // tslint:disable-line no-eval
3+
const evalValue = value => eval(value) // eslint-disable-line no-eval
44

55
const isTransformable = value => typeof value === 'string' && value.includes('names')
66

build/gulp/sh.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
import { spawn } from 'child_process'
1+
import * as childProcess from 'child_process'
22

3-
const sh = (command: string, pipeOutputToResult: boolean = false): Promise<string> => {
4-
return new Promise((resolve, reject) => {
3+
const sh = (command: string, pipeOutputToResult: boolean = false): Promise<string> =>
4+
new Promise((resolve, reject) => {
55
const [cmd, ...args] = command.split(' ')
66

7-
const options = {
7+
const options: childProcess.SpawnOptions = {
88
cwd: process.cwd(),
99
env: process.env,
1010
stdio: pipeOutputToResult ? 'pipe' : [0, 1, 2],
1111
shell: true,
1212
}
1313

14-
const child = spawn(cmd, args, options)
14+
const child = childProcess.spawn(cmd, args, options)
1515

1616
let stdoutData = ''
1717

@@ -29,6 +29,5 @@ const sh = (command: string, pipeOutputToResult: boolean = false): Promise<strin
2929
reject(new Error(`child process exited with code ${code}`))
3030
})
3131
})
32-
}
3332

3433
export default sh

build/gulp/tasks/test-projects/rollup/app.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import React from 'react'
22
import ReactDOM from 'react-dom'
3+
// eslint-disable-next-line import/no-unresolved
34
import { Button, Provider, themes } from '@stardust-ui/react'
45

56
ReactDOM.render(

build/gulp/tasks/test-projects/rollup/rollup.config.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import replace from 'rollup-plugin-replace'
2-
import resolve from 'rollup-plugin-node-resolve'
3-
import commonjs from 'rollup-plugin-commonjs'
1+
import replace from 'rollup-plugin-replace' // eslint-disable-line import/no-unresolved
2+
import resolve from 'rollup-plugin-node-resolve' // eslint-disable-line import/no-unresolved
3+
import commonjs from 'rollup-plugin-commonjs' // eslint-disable-line import/no-unresolved
44

55
const warningWhitelist = [
66
'THIS_IS_UNDEFINED', // comes from TS transforms

package.json

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
"clean:cache": "gulp clean:cache",
2020
"predeploy:docs": "cross-env NODE_ENV=production yarn build:docs",
2121
"deploy:docs": "gulp deploy:docs",
22-
"lint": "tslint -t stylish -p .",
23-
"lint:fix": "yarn lint --fix",
22+
"lint": "eslint .",
23+
"lint:fix": "yarn eslint --fix",
2424
"perf": "cross-env PERF=true gulp perf --times=50",
2525
"prettier": "prettier --list-different \"**/*.{ts,tsx}\"",
2626
"prettier:fix": "prettier --write \"**/*.{ts,tsx}\"",
@@ -45,7 +45,7 @@
4545
"lint-staged": {
4646
"**/*.{ts,tsx}": [
4747
"prettier --write",
48-
"tslint -t stylish --fix",
48+
"eslint --fix",
4949
"git add"
5050
],
5151
"**/*.{js,json}": [
@@ -109,6 +109,14 @@
109109
"doctrine": "^2.0.0",
110110
"enzyme": "^3.7.0",
111111
"enzyme-adapter-react-16": "^1.7.0",
112+
"eslint": "^5.10.0",
113+
"eslint-config-airbnb": "^17.1.0",
114+
"eslint-config-prettier": "^3.3.0",
115+
"eslint-plugin-import": "^2.14.0",
116+
"eslint-plugin-jsx-a11y": "^6.1.2",
117+
"eslint-plugin-prettier": "^3.0.1",
118+
"eslint-plugin-react": "^7.11.1",
119+
"eslint-plugin-typescript": "^0.14.0",
112120
"express": "^4.15.4",
113121
"extract-comments": "^1.0.0",
114122
"faker": "^4.1.0",
@@ -161,9 +169,8 @@
161169
"ts-loader": "^5.3.0",
162170
"ts-node": "^6.1.0",
163171
"tsconfig-paths": "^3.7.0",
164-
"tslint": "^5.11.0",
165-
"tslint-config-airbnb": "^5.11.1",
166-
"typescript": "~3.2.2",
172+
"typescript": "^3.2.2",
173+
"typescript-eslint-parser": "^21.0.2",
167174
"webpack": "^4.25.1",
168175
"webpack-dev-middleware": "^3.4.0",
169176
"webpack-hot-middleware": "^2.18.2"

packages/react/src/.eslintrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"extends": "../.eslintrc.json",
3+
"env": {
4+
"browser": true
5+
}
6+
}

packages/react/src/lib/accessibility/FocusZone/CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ This is a list of changes made to this Stardust copy of FocusZone in comparison
2222
- Add `shouldFocusFirstElementWhenReceivedFocus` prop, which forces focus to first element when container receives focus @sophieH29 ([#469](https://github.com/stardust-ui/react/pull/469))
2323
- Handle keyDownCapture based on `shouldHandleKeyDownCapture` prop @sophieH29 ([#563](https://github.com/stardust-ui/react/pull/563))
2424

25+
### chore: replace ts-lint with eslint [#600](https://github.com/stardust-ui/react/pull/600)
26+
- Reorder functions in the file to fix no-use-before-define
27+
- Refactor "a && a.b()" to an "if" statement to fix no-unused-expressions
28+
2529
### feat(FocusZone): Implement FocusZone into renderComponent [#116](https://github.com/stardust-ui/react/pull/116)
2630
- Prettier and linting fixes, e.g., removing semicolons, removing underscores from private methods.
2731
- Moved `IS_FOCUSABLE_ATTRIBUTE` and others to `focusUtilities.ts`.
@@ -63,4 +67,4 @@ This is a list of changes made to the Stardust copy of FocusTrapZone in comparis
6367
- Used `ReactDOM.findDOMNode` reference instead of `createRef` for `_root`.
6468
- Got rid of `componentWillMount` as it deprecated in higher versions of React.
6569
- Added `aria-hidden` to the body children outside of the Popup to prevent screen reader from reading background information.
66-
- Renamed `focus` method to `_findElementAndFocusAsync`, made it private and removed `IFocusTrapZone` interface as it's no longer needed.
70+
- Renamed `focus` method to `_findElementAndFocusAsync`, made it private and removed `IFocusTrapZone` interface as it's no longer needed.

0 commit comments

Comments
 (0)