Skip to content
This repository was archived by the owner on Jan 26, 2019. It is now read-only.

Commit 09cfcde

Browse files
tharakawjgaearon
authored andcommittedFeb 24, 2017
Add lint rule to disallow require.ensure and System.import (#1536)
1 parent 0ef9e80 commit 09cfcde

File tree

1 file changed

+9
-0
lines changed
  • packages/eslint-config-react-app

1 file changed

+9
-0
lines changed
 

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

+9
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,15 @@ module.exports = {
155155
'unicode-bom': ['warn', 'never'],
156156
'use-isnan': 'warn',
157157
'valid-typeof': 'warn',
158+
'no-restricted-properties': ['error', {
159+
object: 'require',
160+
property: 'ensure',
161+
message: 'Please use import() instead. More info: https://webpack.js.org/guides/code-splitting-import/#dynamic-import'
162+
}, {
163+
object: 'System',
164+
property: 'import',
165+
message: 'Please use import() instead. More info: https://webpack.js.org/guides/code-splitting-import/#dynamic-import'
166+
}],
158167

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

0 commit comments

Comments
 (0)