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

Commit

Permalink
actually set parserOptions for babel-eslint because of eslint/eslint#…
Browse files Browse the repository at this point in the history
  • Loading branch information
lukekarrys committed Jun 23, 2017
1 parent 30c7517 commit e3d7cd8
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 7 deletions.
2 changes: 2 additions & 0 deletions base.js
@@ -1,3 +1,5 @@
'use strict';

module.exports = {
env: {
browser: false,
Expand Down
6 changes: 6 additions & 0 deletions index.js
@@ -1,8 +1,14 @@
'use strict';

module.exports = {
'extends': './base.js',

parser: 'babel-eslint',

parserOptions: {
sourceType: 'module'
},

plugins: [
'react',
'classes',
Expand Down
2 changes: 2 additions & 0 deletions no-babel.js
@@ -1,3 +1,5 @@
'use strict';

module.exports = {
'extends': './base.js',

Expand Down
4 changes: 1 addition & 3 deletions package.json
Expand Up @@ -18,7 +18,6 @@
"eslint-plugin-react": "^7.1.0",
"espree": "^3.4.3",
"git-validate": "^2.2.2",
"greenkeeper-postpublish": "^1.0.1",
"tape": "^4.6.3",
"webpack": "^3.0.0"
},
Expand All @@ -43,8 +42,7 @@
"url": "git://github.com/lukekarrys/eslint-config.git"
},
"scripts": {
"lint": "eslint -c index.js .",
"postpublish": "greenkeeper-postpublish",
"lint": "eslint -c no-babel.js .",
"test": "tape test/*.js",
"validate": "npm ls >/dev/null"
}
Expand Down
5 changes: 1 addition & 4 deletions test/validate-config.js
Expand Up @@ -28,10 +28,7 @@ t(bar);
test('load config in eslint to validate all rule syntax is correct', (t) => {
const {results, errorCount, warningCount} = new CLIEngine({
useEslintrc: false,
configFile: 'index.js',
parserOptions: {
sourceType: 'module'
}
configFile: 'index.js'
}).executeOnText(code);

t.equal(results.length, 1, 'One result (empty)');
Expand Down

0 comments on commit e3d7cd8

Please sign in to comment.