Skip to content

Commit

Permalink
Forbid Webpack loader syntax in imports
Browse files Browse the repository at this point in the history
Enable no-webpack-loader-syntax rule in eslint-config-react-app.
  • Loading branch information
fson committed Oct 22, 2016
1 parent d5de99e commit cecacc9
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions packages/eslint-config-react-app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ module.exports = {

parser: 'babel-eslint',

// import plugin is temporarily disabled, scroll below to see why
plugins: [/*'import', */'flowtype', 'jsx-a11y', 'react'],
plugins: ['import', 'flowtype', 'jsx-a11y', 'react'],

env: {
browser: true,
Expand Down Expand Up @@ -170,6 +169,9 @@ module.exports = {
// This is probably fixable with a patch to eslint-loader.
// When file A is saved, we want to invalidate all files that import it
// *and* that currently have lint errors. This should fix the problem.
// (As an exception, import/no-webpack-loader-syntax can be enabled already
// because it doesn't depend on whether the file exists, so this issue
// doesn't apply to it.)

// 'import/default': 'warn',
// 'import/export': 'warn',
Expand All @@ -181,6 +183,9 @@ module.exports = {
// 'import/no-named-as-default': 'warn',
// 'import/no-named-as-default-member': 'warn',
// 'import/no-unresolved': ['warn', { commonjs: true }],
// We don't support configuring Webpack using import source strings, so this
// is always an error.
'import/no-webpack-loader-syntax': 'error',

// https://github.com/yannickcr/eslint-plugin-react/tree/master/docs/rules
'react/jsx-equals-spacing': ['warn', 'never'],
Expand Down

0 comments on commit cecacc9

Please sign in to comment.