Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 2750090

Browse filesBrowse files
authored
Forbid Webpack loader syntax in imports (facebook#803)
Enable no-webpack-loader-syntax rule in eslint-config-react-app.
1 parent d5de99e commit 2750090
Copy full SHA for 2750090

File tree

Expand file treeCollapse file tree

1 file changed

+7
-2
lines changed
Filter options
  • packages/eslint-config-react-app
Expand file treeCollapse file tree

1 file changed

+7
-2
lines changed

‎packages/eslint-config-react-app/index.js

Copy file name to clipboardExpand all lines: packages/eslint-config-react-app/index.js
+7-2Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ module.exports = {
2121

2222
parser: 'babel-eslint',
2323

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

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

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

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

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.