Created
May 5, 2019 12:31
-
-
Save AWolf81/5f049310e07f9e52e6eab42bc0357b5d to your computer and use it in GitHub Desktop.
BoostNote linting test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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