Skip to content
This repository was archived by the owner on Feb 9, 2025. It is now read-only.

Commit e5f05c1

Browse files
committed
feat: Disable import/no-anonymous-default-export in config files
1 parent 3713906 commit e5f05c1

File tree

4 files changed

+20
-0
lines changed

4 files changed

+20
-0
lines changed

base.js

+5
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
const options = require("./options.js");
55
const globPatterns = require("./glob-patterns.js");
66
const tests = require("./tests.js");
7+
const configs = require("./configs.js");
78

89
module.exports = {
910
parser: "@babel/eslint-parser",
@@ -594,5 +595,9 @@ module.exports = {
594595
files: globPatterns.tests,
595596
...tests,
596597
},
598+
{
599+
files: globPatterns.configs,
600+
...configs,
601+
},
597602
],
598603
};

configs.js

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/* eslint sort-keys: ["error", "asc"] */
2+
/* eslint-disable sort-keys */
3+
4+
module.exports = {
5+
env: {
6+
node: true,
7+
},
8+
rules: {
9+
// Config files are usually not imported anywhere else so this is fine
10+
"import/no-anonymous-default-export": "off",
11+
},
12+
};

glob-patterns.js

+1
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,5 @@ module.exports = {
1717
],
1818
typescript: ["*.ts", "*.tsx"],
1919
react: ["*.jsx", "*.tsx"],
20+
configs: ["*.config.*"],
2021
};

tests/javascript/webpack.config.js

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// Should not generate an error in .config-files
2+
export default {};

0 commit comments

Comments
 (0)