Skip to content

Commit

Permalink
fix: 🐛 change the way cjs files are handled
Browse files Browse the repository at this point in the history
  • Loading branch information
nnmrts committed Jan 18, 2021
1 parent 0e7ebd9 commit db04c83
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 24 deletions.
12 changes: 1 addition & 11 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
module.exports = {
extends: ["./index.cjs"],
overrides: [
{
files: ["**/**.cjs"],
rules: {
"import/no-commonjs": "off",
"import/no-unused-modules": "off"
}
}
],
rules: {}
extends: ["./index.cjs"]
};
19 changes: 6 additions & 13 deletions rules/imports.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ module.exports = {
},
overrides: [
{
files: "babel.config.*",
files: ["example.js"],
rules: {
"import/no-commonjs": "off",
"import/no-unused-modules": "off"
}
},
{
files: ["example.js"],
files: "**/**.cjs",
rules: {
"import/no-commonjs": "off",
"import/no-unused-modules": "off"
}
}
Expand Down Expand Up @@ -125,12 +125,7 @@ module.exports = {
"import/no-unused-modules": [
"error",
{
ignoreExports: [
"./src/index.js",
"./index.js",
"./src/index.cjs",
"./index.cjs"
],
ignoreExports: ["./src/index.*", "./index.*"],
missingExports: true,
unusedExports: false
}
Expand Down Expand Up @@ -163,16 +158,14 @@ module.exports = {
"import/extensions": [
".js",
".mjs",
".jsx",
".cjs"
".jsx"
],
"import/ignore": ["node_modules", "\\.(coffee|scss|css|less|hbs|svg|json)$"],
"import/ignore": ["node_modules", "\\.(coffee|scss|css|less|hbs|svg|json|cjs)$"],
"import/resolver": {
node: {
extensions: [
".js",
".mjs",
".cjs",
".json"
]
}
Expand Down

0 comments on commit db04c83

Please sign in to comment.