forked from openedx/frontend-app-authoring
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.eslintrc.diff.js
More file actions
39 lines (37 loc) · 1.22 KB
/
.eslintrc.diff.js
File metadata and controls
39 lines (37 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
const path = require('path');
// Additional eslint rules specific to the Authoring MFE, which only run on modified files.
module.exports = {
rules: {
'no-restricted-imports': ['error', {
patterns: [
{
// Ban injectIntl() HOC
group: ['@edx/frontend-platform/i18n'],
importNames: ['injectIntl'],
message: "Use 'useIntl' hook instead of injectIntl.",
},
{
// Ban connect()/mapStateToProps/mapDispatchToProps HOC pattern
group: ['react-redux'],
importNames: ['connect'],
message: "Use 'useDispatch' and 'useSelector' hooks instead of 'connect'.",
},
// In the near future we will require 'propTypes' to be removed from all modified code too:
// {
// group: ['prop-types'],
// message: 'Use TypeScript types instead of propTypes.',
// },
],
}],
// Ban 'defaultProps' from any modified code.
'react/require-default-props': ['error', { functions: 'defaultArguments' }],
},
settings: {
// Import URLs should be resolved using aliases
'import/resolver': {
webpack: {
config: path.resolve(__dirname, 'webpack.dev.config.js'),
},
},
},
};