Skip to content

Commit

Permalink
Apply stricter ESM rules
Browse files Browse the repository at this point in the history
Closes $61.
  • Loading branch information
niksy committed Apr 14, 2024
1 parent 32e5828 commit fcef4bb
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
10 changes: 8 additions & 2 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
{
"root": true,
"extends": ["./index.js", "eslint-config-prettier"],
"plugins": ["eslint-plugin-prettier", "eslint-plugin-unicorn"],
"plugins": [
"eslint-plugin-prettier",
"eslint-plugin-unicorn",
"eslint-plugin-import"
],
"rules": {
"prettier/prettier": 1
"prettier/prettier": 1,
"unicorn/prefer-module": 0,
"import/no-commonjs": 0
},
"ignorePatterns": ["test/fixtures/*.config.*"],
"overrides": [
Expand Down
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ module.exports = {
'import/no-self-import': 2,
'import/export': 2,
'import/no-mutable-exports': 2,
'import/no-commonjs': 1,
'import/no-commonjs': 2,
'import/no-amd': 1,
'import/exports-last': 2,
'import/no-namespace': 1,
Expand Down Expand Up @@ -562,7 +562,7 @@ module.exports = {
'import/no-named-export': 0,
'import/no-unused-modules': 0,
'unicorn/prefer-export-from': 0,
'unicorn/prefer-module': 1,
'unicorn/prefer-module': 2,
'n/file-extension-in-import': 0,
'import/extensions': [2, 'always', { ignorePackages: true }],
'import/consistent-type-specifier-style': 0,
Expand Down
5 changes: 5 additions & 0 deletions test/.eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,10 @@
"parserOptions": {
"ecmaVersion": 2022,
"sourceType": "module"
},
"plugins": ["eslint-plugin-unicorn", "eslint-plugin-import"],
"rules": {
"unicorn/prefer-module": 2,
"import/no-commonjs": 2
}
}

0 comments on commit fcef4bb

Please sign in to comment.