Skip to content

Commit b9845de

Browse files
committed
fix(errors): Move no-restricted-exports to es6 rules, enable
1 parent abb2346 commit b9845de

File tree

3 files changed

+18
-4
lines changed

3 files changed

+18
-4
lines changed

packages/eslint-config-zillow-base/rules/errors.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,6 @@ module.exports = {
112112
// disallow multiple spaces in a regular expression literal
113113
'no-regex-spaces': 'error',
114114

115-
// https://eslint.org/docs/rules/no-restricted-exports
116-
'no-restricted-exports': 'off',
117-
118115
// https://eslint.org/docs/rules/no-setter-return
119116
'no-setter-return': 'error',
120117

packages/eslint-config-zillow-base/rules/es6.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,17 @@ module.exports = {
6363
// https://eslint.org/docs/rules/no-new-symbol
6464
'no-new-symbol': 'error',
6565

66+
// Disallow specified names in exports
67+
// https://eslint.org/docs/rules/no-restricted-exports
68+
'no-restricted-exports': ['error', {
69+
restrictedNamedExports: [
70+
// use `export default` to provide a default export
71+
'default',
72+
// this will cause tons of confusion when your module is dynamically `import()`ed
73+
'then',
74+
],
75+
}],
76+
6677
// disallow specific imports
6778
// https://eslint.org/docs/rules/no-restricted-imports
6879
'no-restricted-imports': ['off', {

packages/eslint-plugin-zillow/test/__snapshots__/eslint-plugin-zillow.test.js.snap

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1172,7 +1172,13 @@ Object {
11721172
"error",
11731173
],
11741174
"no-restricted-exports": Array [
1175-
"off",
1175+
"error",
1176+
Object {
1177+
"restrictedNamedExports": Array [
1178+
"default",
1179+
"then",
1180+
],
1181+
},
11761182
],
11771183
"no-restricted-globals": Array [
11781184
"error",

0 commit comments

Comments
 (0)