Skip to content

Instantly share code, notes, and snippets.

@AWolf81 AWolf81/test.js
Created May 5, 2019

Embed
What would you like to do?
BoostNote linting test
import React from 'react'
import ReactDOM from 'react-dom'
// import PropTypes from 'prop-types'
// Note: Remove the next line to test linting warnings
/* eslint-disable */
// Test prefer-const --> rule working with standardx as it respects .eslintrc
export const preferCondtDemo = function () {
let notVariable = 'demo'
return notVariable
}
// No-useless-escape changed and must be disabled with disable-line
export const noUselessEscape = function () {
const reg = /[\+a]/g
return reg
}
// ^---- disabled so we're not getting a linting error
// warns for unused var
export const noUnuseVars = function () {
const notUsed = 'test'
}
// warns for lone block
{
console.log("I'm lonely")
}
/* eslint-enable */
// react/prop-types validates if propType is defined
// --> rule is disabled
export class ReactProps extends React.Component {
render () {
const { visible } = this.props
return visible && (
<div>Will warn for visible prop missing</div>
)
}
}
const root = document.createElement('div')
ReactDOM.render(<ReactProps />, root)
ReactProps.propTypes = {
// visible: PropTypes.bool.isRequired
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.