mirror of
https://github.com/oceanprotocol/commons.git
synced 2023-03-15 18:03:00 +01:00
lint fixes & package updates
This commit is contained in:
parent
7d4261cec1
commit
9bdcf8fb6b
@ -6,10 +6,11 @@
|
||||
"extends": [
|
||||
"oceanprotocol",
|
||||
"oceanprotocol/react",
|
||||
"plugin:prettier/recommended",
|
||||
"prettier/react",
|
||||
"prettier/standard",
|
||||
"plugin:@typescript-eslint/recommended"
|
||||
"plugin:prettier/recommended",
|
||||
"plugin:@typescript-eslint/recommended",
|
||||
"prettier/@typescript-eslint"
|
||||
],
|
||||
"plugins": ["@typescript-eslint", "prettier"],
|
||||
"rules": {
|
||||
@ -20,6 +21,8 @@
|
||||
]
|
||||
},
|
||||
"env": {
|
||||
"es6": true,
|
||||
"browser": true,
|
||||
"jest": true
|
||||
}
|
||||
}
|
||||
|
@ -49,7 +49,7 @@ See the section about [running tests](https://facebook.github.io/create-react-ap
|
||||
For linting and auto-formatting you can use:
|
||||
|
||||
```bash
|
||||
# auto format all ts & css with tslint & stylelint
|
||||
# auto format all ts & css with eslint & stylelint
|
||||
npm run lint
|
||||
|
||||
# auto format all ts & css with prettier, taking all configs into account
|
||||
|
6971
package-lock.json
generated
6971
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
27
package.json
27
package.json
@ -15,41 +15,38 @@
|
||||
"lint": "npm run lint:js && npm run lint:css"
|
||||
},
|
||||
"dependencies": {
|
||||
"@oceanprotocol/squid": "^0.2.7",
|
||||
"@oceanprotocol/squid": "^0.2.8",
|
||||
"classnames": "^2.2.6",
|
||||
"query-string": "^6.2.0",
|
||||
"react": "^16.7.0",
|
||||
"react-dom": "^16.7.0",
|
||||
"react": "^16.8.1",
|
||||
"react-dom": "^16.8.1",
|
||||
"react-router-dom": "^4.3.1",
|
||||
"web3": "^1.0.0-beta.37"
|
||||
"web3": "^1.0.0-beta.43"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/classnames": "^2.2.7",
|
||||
"@types/jest": "23.3.13",
|
||||
"@types/node": "10.12.19",
|
||||
"@types/jest": "^24.0.0",
|
||||
"@types/node": "^10.12.21",
|
||||
"@types/query-string": "^6.2.0",
|
||||
"@types/react": "16.7.22",
|
||||
"@types/react-dom": "16.0.11",
|
||||
"@types/react": "^16.8.2",
|
||||
"@types/react-dom": "^16.8.0",
|
||||
"@types/react-router-dom": "^4.3.1",
|
||||
"@types/web3": "^1.0.18",
|
||||
"@typescript-eslint/eslint-plugin": "^1.2.0",
|
||||
"@typescript-eslint/parser": "^1.2.0",
|
||||
"eslint-config-oceanprotocol": "^1.3.0",
|
||||
"eslint-config-prettier": "^3.3.0",
|
||||
"eslint-plugin-prettier": "^3.0.0",
|
||||
"eslint-config-prettier": "^4.0.0",
|
||||
"eslint-plugin-prettier": "^3.0.1",
|
||||
"node-sass": "^4.11.0",
|
||||
"prettier": "^1.16.2",
|
||||
"prettier": "^1.16.4",
|
||||
"prettier-stylelint": "^0.4.2",
|
||||
"react-scripts": "2.1.3",
|
||||
"react-scripts": "^2.1.3",
|
||||
"stylelint": "^9.10.1",
|
||||
"stylelint-config-bigchaindb": "^1.2.1",
|
||||
"stylelint-config-css-modules": "^1.3.0",
|
||||
"stylelint-config-standard": "^18.2.0",
|
||||
"typescript": "3.2.4"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"extends": "react-app"
|
||||
},
|
||||
"browserslist": [
|
||||
">0.2%",
|
||||
"not dead",
|
||||
|
@ -12,7 +12,7 @@ import Styleguide from './pages/Styleguide'
|
||||
const Routes = () => (
|
||||
<Router>
|
||||
<Switch>
|
||||
<Route exact={true} component={Home} path="/" />
|
||||
<Route exact component={Home} path="/" />
|
||||
<Route component={Styleguide} path="/styleguide" />
|
||||
<Route component={About} path="/about" />
|
||||
<Route component={Publish} path="/publish" />
|
||||
|
@ -7,7 +7,7 @@ it('Button renders without crashing', () => {
|
||||
ReactDOM.render(
|
||||
<>
|
||||
<Button>I am a button</Button>
|
||||
<Button primary={true}>I am a primary button</Button>
|
||||
<Button primary>I am a primary button</Button>
|
||||
<Button href="https://hello.com">I am a button</Button>
|
||||
</>,
|
||||
div
|
||||
|
@ -6,12 +6,12 @@ import styles from './Input.module.scss'
|
||||
import Label from './Label'
|
||||
import Row from './Row'
|
||||
|
||||
interface IOptionProps {
|
||||
interface OptionProps {
|
||||
value: string
|
||||
label: string
|
||||
}
|
||||
|
||||
interface IInputProps {
|
||||
interface InputProps {
|
||||
name: string
|
||||
label: string
|
||||
placeholder?: string
|
||||
@ -20,11 +20,11 @@ interface IInputProps {
|
||||
tag?: string
|
||||
type?: string
|
||||
small?: boolean
|
||||
options?: IOptionProps[]
|
||||
options?: OptionProps[]
|
||||
additionalComponent?: void
|
||||
}
|
||||
|
||||
interface IInputState {
|
||||
interface InputState {
|
||||
isFocused: boolean
|
||||
}
|
||||
|
||||
@ -38,8 +38,8 @@ const Tag = ({ ...props }) => {
|
||||
}
|
||||
}
|
||||
|
||||
export default class Input extends PureComponent<IInputProps, IInputState> {
|
||||
public state: IInputState = { isFocused: false }
|
||||
export default class Input extends PureComponent<InputProps, InputState> {
|
||||
public state: InputState = { isFocused: false }
|
||||
|
||||
public inputWrapClasses() {
|
||||
if (this.props.type === 'search') {
|
||||
@ -64,7 +64,6 @@ export default class Input extends PureComponent<IInputProps, IInputState> {
|
||||
required,
|
||||
type,
|
||||
help,
|
||||
small,
|
||||
tag,
|
||||
additionalComponent,
|
||||
children,
|
||||
@ -80,7 +79,6 @@ export default class Input extends PureComponent<IInputProps, IInputState> {
|
||||
|
||||
{type === 'radio' || type === 'checkbox' ? (
|
||||
<div className={styles.radioGroup}>
|
||||
{/* tslint:disable-next-line:jsx-no-multiline-js */}
|
||||
{options &&
|
||||
options.map((option, index) => (
|
||||
<div className={styles.radioWrap} key={index}>
|
||||
@ -111,7 +109,6 @@ export default class Input extends PureComponent<IInputProps, IInputState> {
|
||||
onFocus={this.toggleFocus}
|
||||
onBlur={this.toggleFocus}
|
||||
>
|
||||
{/* tslint:disable-next-line:jsx-no-multiline-js */}
|
||||
{tag === 'select'
|
||||
? options &&
|
||||
options.map((option, index) => (
|
||||
|
@ -213,7 +213,7 @@ class Publish extends Component<{}, PublishState> {
|
||||
/>
|
||||
</div>
|
||||
<User.Consumer>
|
||||
{(states /* tslint:disable-next-line */) => (
|
||||
{states => (
|
||||
<div>
|
||||
{states.isLogged ? (
|
||||
<div>
|
||||
|
@ -27,7 +27,7 @@ class Styleguide extends Component {
|
||||
<h1>Styleguide</h1>
|
||||
|
||||
<Button>I am a button</Button>
|
||||
<Button primary={true}>I am a primary button</Button>
|
||||
<Button primary>I am a primary button</Button>
|
||||
<Button href="https://hello.com">
|
||||
I am a link disguised as a button
|
||||
</Button>
|
||||
|
12
tslint.json
12
tslint.json
@ -1,12 +0,0 @@
|
||||
{
|
||||
"defaultSeverity": "error",
|
||||
"extends": ["tslint:recommended", "tslint-react", "tslint-config-prettier"],
|
||||
"jsRules": {},
|
||||
"rules": {
|
||||
"object-literal-sort-keys": false,
|
||||
"semicolon": [true, "never"]
|
||||
},
|
||||
"linterOptions": {
|
||||
"exclude": ["node_modules/**/*.{ts,tsx}"]
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user