Skip to content

Commit

Permalink
feat: support for mjs files
Browse files Browse the repository at this point in the history
  • Loading branch information
belgattitude committed Sep 15, 2022
1 parent 681deb1 commit 3d609eb
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/brown-ducks-return.md
@@ -0,0 +1,5 @@
---
'@belgattitude/eslint-config-bases': minor
---

Support for mjs files
2 changes: 1 addition & 1 deletion packages/eslint-config-bases/src/bases/sonar.js
Expand Up @@ -38,7 +38,7 @@ module.exports = {
},
{
// relax javascript code as it often contains obscure configs
files: ['*.js', '*.cjs', '*.mjs'],
files: ['*.js', '*.cjs'],
parser: 'espree',
parserOptions: {
ecmaVersion: 2020,
Expand Down
17 changes: 15 additions & 2 deletions packages/eslint-config-bases/src/bases/typescript.js
Expand Up @@ -158,8 +158,21 @@ module.exports = {
},
overrides: [
{
// javascript commonjs or module
files: ['*.js', '*.cjs', '*.mjs'],
files: ['*.mjs'],
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
},
rules: {
'@typescript-eslint/naming-convention': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/consistent-type-exports': 'off',
'@typescript-eslint/consistent-type-imports': 'off',
},
},
{
// javascript commonjs
files: ['*.js', '*.cjs'],
parser: 'espree',
parserOptions: {
ecmaVersion: 2020,
Expand Down

0 comments on commit 3d609eb

Please sign in to comment.