Skip to content

Commit

Permalink
Add lint rule to disallow require.ensure and System.import (#1536)
Browse files Browse the repository at this point in the history
  • Loading branch information
tharakawj authored and gaearon committed Feb 24, 2017
1 parent 0ef9e80 commit 09cfcde
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/eslint-config-react-app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,15 @@ module.exports = {
'unicode-bom': ['warn', 'never'],
'use-isnan': 'warn',
'valid-typeof': 'warn',
'no-restricted-properties': ['error', {
object: 'require',
property: 'ensure',
message: 'Please use import() instead. More info: https://webpack.js.org/guides/code-splitting-import/#dynamic-import'
}, {
object: 'System',
property: 'import',
message: 'Please use import() instead. More info: https://webpack.js.org/guides/code-splitting-import/#dynamic-import'
}],

// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/

Expand Down

0 comments on commit 09cfcde

Please sign in to comment.