Skip to content

Commit

Permalink
Check more file extensions
Browse files Browse the repository at this point in the history
- .*.js
- *.mjs
- .*.mjs
- *.cts
- .*.cts
- *.mts
- .*.mts
  • Loading branch information
EvgenyOrekhov committed Jun 25, 2024
1 parent 89cb72f commit ac2795a
Show file tree
Hide file tree
Showing 8 changed files with 76 additions and 4 deletions.
4 changes: 3 additions & 1 deletion base.json
Original file line number Diff line number Diff line change
Expand Up @@ -957,6 +957,8 @@
},

"overrides": [
{ "files": [".*.js", "*.mjs", ".*.mjs", "*.cjs", ".*.cjs"] },

{
"files": [
"**/test/**",
Expand Down Expand Up @@ -1078,7 +1080,7 @@
},

{
"files": ["*.cjs", ".*.cjs", "*.cts", ".*.cts"],
"files": ["*.cjs", ".*.cjs"],

"parserOptions": {
"sourceType": "script"
Expand Down
5 changes: 5 additions & 0 deletions esm/test.cts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/* eslint-disable no-console */

"use strict";

console.log("test");
2 changes: 1 addition & 1 deletion esm/test.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
eslint-disable-next-line
import/no-unused-modules
import/no-anonymous-default-export
*/
export default "test";
6 changes: 6 additions & 0 deletions esm/test.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/*
eslint-disable-next-line
import/no-unused-modules,
import/no-anonymous-default-export
*/
export default "test";
5 changes: 5 additions & 0 deletions test.cts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/* eslint-disable no-console */

"use strict";

console.log("test");
2 changes: 1 addition & 1 deletion test.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
eslint-disable-next-line
import/no-unused-modules
import/no-anonymous-default-export
*/
export default "test";
6 changes: 6 additions & 0 deletions test.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/*
eslint-disable-next-line
import/no-unused-modules,
import/no-anonymous-default-export
*/
export default "test";
50 changes: 49 additions & 1 deletion ts.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,16 @@

"overrides": [
{
"files": ["*.ts", "*.tsx", "*.vue"],
"files": [
"*.ts",
".*.ts",
"*.tsx",
"*.mts",
".*.mts",
"*.cts",
".*.cts",
"*.vue"
],

"extends": [
"plugin:import/typescript",
Expand Down Expand Up @@ -168,6 +177,45 @@
}
},

{
"files": ["*.cts", ".*.cts"],

"parserOptions": {
"sourceType": "script"
},

"env": {
"commonjs": true
},

"rules": {
"import/order": [
"error",
{
"groups": [
"builtin",
"external",
"internal",
"unknown",
"parent",
"sibling",
"index"
],
"newlines-between": "always",
"alphabetize": {
"order": "asc",
"orderImportKind": "asc",
"caseInsensitive": true
}
}
],

"unicorn/prefer-module": "off",
"import/no-commonjs": "off",
"import/unambiguous": "off"
}
},

{
"files": [
"**/test/**",
Expand Down

0 comments on commit ac2795a

Please sign in to comment.