Skip to content
This repository has been archived by the owner on Jul 7, 2022. It is now read-only.

Commit

Permalink
fix(eslint): Use babel-eslint parser
Browse files Browse the repository at this point in the history
The eslint config will now use babel-eslint as its parser. So that things like class-properties work
out of the box. This commit also adds a couple other things such as env and rules

fix #3
  • Loading branch information
adambrgmn committed Nov 29, 2017
1 parent 22bc9b3 commit 427f2f6
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
22 changes: 21 additions & 1 deletion src/config/eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,30 @@
const { ifAnyDep } = require('../utils');

module.exports = {
parser: 'babel-eslint',
extends: [
require.resolve('eslint-config-airbnb-base'),
ifAnyDep('react', require.resolve('eslint-config-airbnb')),
require.resolve('eslint-config-prettier'),
].filter(Boolean),
rules: {},
plugins: ['babel'],
env: {
browser: true,
node: true,
commonjs: true,
'shared-node-browser': true,
es6: true,
worker: true,
jest: true,
},
parserOptions: {
ecmaVersion: 6,
sourceType: 'module',
ecmaFeatures: { experimentalObjectRestSpread: true },
},
rules: {
'import/prefer-default-export': 'off',
'react/jsx-filename-extension': 'off',
'react/sort-comp': 'off',
},
};
1 change: 1 addition & 0 deletions src/scripts/lint.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const useBuiltinConfig =
!args.includes('--config') &&
!hasFile('.eslintrc') &&
!hasFile('.eslintrc.js') &&
!hasFile('.eslintrc.json') &&
!hasPkgProp('eslintConfig');

const config = useBuiltinConfig
Expand Down

0 comments on commit 427f2f6

Please sign in to comment.