Created
September 8, 2015 09:52
-
-
Save pveyes/46685fa5cc97952466fd to your computer and use it in GitHub Desktop.
This file contains 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
module.exports = { | |
parser: 'babel-eslint', | |
plugins: ['babel', 'react'], | |
envs: { | |
es6: true, | |
node: true | |
}, | |
ecmaFeatures: { | |
jsx: true | |
}, | |
rules: { | |
'react/jsx-uses-react': 2, | |
'react/react-in-jsx-scope': 2 | |
} | |
} |
This file contains 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
/* @flow */ | |
class Foo { | |
render() : ReactElement { | |
return <div></div> | |
} | |
} |
This file contains 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
{ | |
"devDependencies": { | |
"eslint": "^1.3.1" | |
}, | |
"dependencies": { | |
"babel-eslint": "^4.1.1", | |
"eslint-plugin-babel": "^2.1.1", | |
"eslint-plugin-react": "^3.3.1" | |
} | |
} |
This file contains 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
var fs = require('fs'); | |
var eslint = require('eslint'); | |
var tempWrite = require('temp-write'); | |
var test = require('ava'); | |
test('node', function(t) { | |
var conf = require('./eslint-config-x'); | |
var file = fs.readFileSync('./fixture.js', { encoding: 'utf-8'} ); | |
var linter = new eslint.CLIEngine({ | |
useEslintrc: false, | |
configFile: tempWrite.sync(JSON.stringify(conf)) | |
}); | |
var errors = linter.executeOnText(file).results[0].messages; | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment