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

Commit

Permalink
chore: replace ts-lint with eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
levithomason authored and layershifter committed Feb 8, 2019
1 parent fc0d558 commit be899a8
Show file tree
Hide file tree
Showing 12 changed files with 278 additions and 260 deletions.
5 changes: 5 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.awcache/
coverage/
dist/
dll/
node_modules/
13 changes: 13 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"extends": ["airbnb", "plugin:prettier/recommended"],
"parser": "typescript-eslint-parser",
"plugins": ["import", "prettier"],
"env": {
"browser": true
},
"rules": {
"import/no-extraneous-dependencies": "off",
"prettier/prettier": "error",
"semi": ["error", "never"]
}
}
8 changes: 0 additions & 8 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,19 +1,11 @@
.github/

# editor configs
.idea/
.vscode/


coverage/

dist/
dll/
docs/src/componentInfo
docs/src/componentMenu.json
docs/src/behaviorMenu.json
docs/src/exampleMenus
docs/dist/
stats/

package.json
10 changes: 1 addition & 9 deletions .prettierrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,8 @@
"$schema": "http://json.schemastore.org/prettierrc",
"htmlWhitespaceSensitivity": "ignore",
"printWidth": 100,
"tabWidth": 2,
"semi": false,
"singleQuote": true,
"trailingComma": "all",
"overrides": [
{
"files": ".prettierrc",
"options": {
"parser": "json"
}
}
]
"tabWidth": 2
}
2 changes: 1 addition & 1 deletion build/gulp/plugins/util/parseType.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const _ = require('lodash')

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

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

Expand Down
11 changes: 5 additions & 6 deletions build/gulp/sh.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import { spawn } from 'child_process'
import * as childProcess from 'child_process'

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

const options = {
const options: childProcess.SpawnOptions = {
cwd: process.cwd(),
env: process.env,
stdio: pipeOutputToResult ? 'pipe' : [0, 1, 2],
shell: true,
}

const child = spawn(cmd, args, options)
const child = childProcess.spawn(cmd, args, options)

let stdoutData = ''

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

export default sh
1 change: 1 addition & 0 deletions build/gulp/tasks/test-projects/rollup/app.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from 'react'
import ReactDOM from 'react-dom'
// eslint-disable-next-line import/no-unresolved
import { Button, Provider, themes } from '@stardust-ui/react'

ReactDOM.render(
Expand Down
6 changes: 3 additions & 3 deletions build/gulp/tasks/test-projects/rollup/rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import replace from 'rollup-plugin-replace'
import resolve from 'rollup-plugin-node-resolve'
import commonjs from 'rollup-plugin-commonjs'
import replace from 'rollup-plugin-replace' // eslint-disable-line import/no-unresolved
import resolve from 'rollup-plugin-node-resolve' // eslint-disable-line import/no-unresolved
import commonjs from 'rollup-plugin-commonjs' // eslint-disable-line import/no-unresolved

const warningWhitelist = [
'THIS_IS_UNDEFINED', // comes from TS transforms
Expand Down
19 changes: 13 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
"clean:cache": "gulp clean:cache",
"predeploy:docs": "cross-env NODE_ENV=production yarn build:docs",
"deploy:docs": "gulp deploy:docs",
"lint": "tslint -t stylish -p .",
"lint:fix": "yarn lint --fix",
"lint": "eslint .",
"lint:fix": "yarn eslint --fix",
"perf": "cross-env PERF=true gulp perf --times=50",
"prettier": "prettier --list-different \"**/*.{ts,tsx}\"",
"prettier:fix": "prettier --write \"**/*.{ts,tsx}\"",
Expand All @@ -45,7 +45,7 @@
"lint-staged": {
"**/*.{ts,tsx}": [
"prettier --write",
"tslint -t stylish --fix",
"eslint --fix",
"git add"
],
"**/*.{js,json}": [
Expand Down Expand Up @@ -109,6 +109,14 @@
"doctrine": "^2.0.0",
"enzyme": "^3.7.0",
"enzyme-adapter-react-16": "^1.7.0",
"eslint": "^5.10.0",
"eslint-config-airbnb": "^17.1.0",
"eslint-config-prettier": "^3.3.0",
"eslint-plugin-import": "^2.14.0",
"eslint-plugin-jsx-a11y": "^6.1.2",
"eslint-plugin-prettier": "^3.0.1",
"eslint-plugin-react": "^7.11.1",
"eslint-plugin-typescript": "^0.14.0",
"express": "^4.15.4",
"extract-comments": "^1.0.0",
"faker": "^4.1.0",
Expand Down Expand Up @@ -161,9 +169,8 @@
"ts-loader": "^5.3.0",
"ts-node": "^6.1.0",
"tsconfig-paths": "^3.7.0",
"tslint": "^5.11.0",
"tslint-config-airbnb": "^5.11.1",
"typescript": "~3.2.2",
"typescript": "^3.2.2",
"typescript-eslint-parser": "^21.0.2",
"webpack": "^4.25.1",
"webpack-dev-middleware": "^3.4.0",
"webpack-hot-middleware": "^2.18.2"
Expand Down
6 changes: 6 additions & 0 deletions packages/react/src/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": "../.eslintrc.json",
"env": {
"browser": true
}
}
6 changes: 5 additions & 1 deletion packages/react/src/lib/accessibility/FocusZone/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ This is a list of changes made to this Stardust copy of FocusZone in comparison
- Add `shouldFocusFirstElementWhenReceivedFocus` prop, which forces focus to first element when container receives focus @sophieH29 ([#469](https://github.com/stardust-ui/react/pull/469))
- Handle keyDownCapture based on `shouldHandleKeyDownCapture` prop @sophieH29 ([#563](https://github.com/stardust-ui/react/pull/563))

### chore: replace ts-lint with eslint [#600](https://github.com/stardust-ui/react/pull/600)
- Reorder functions in the file to fix no-use-before-define
- Refactor "a && a.b()" to an "if" statement to fix no-unused-expressions

### feat(FocusZone): Implement FocusZone into renderComponent [#116](https://github.com/stardust-ui/react/pull/116)
- Prettier and linting fixes, e.g., removing semicolons, removing underscores from private methods.
- Moved `IS_FOCUSABLE_ATTRIBUTE` and others to `focusUtilities.ts`.
Expand Down Expand Up @@ -63,4 +67,4 @@ This is a list of changes made to the Stardust copy of FocusTrapZone in comparis
- Used `ReactDOM.findDOMNode` reference instead of `createRef` for `_root`.
- Got rid of `componentWillMount` as it deprecated in higher versions of React.
- Added `aria-hidden` to the body children outside of the Popup to prevent screen reader from reading background information.
- Renamed `focus` method to `_findElementAndFocusAsync`, made it private and removed `IFocusTrapZone` interface as it's no longer needed.
- Renamed `focus` method to `_findElementAndFocusAsync`, made it private and removed `IFocusTrapZone` interface as it's no longer needed.
Loading

0 comments on commit be899a8

Please sign in to comment.