Skip to content

Commit e059b81

Browse files
👷 fix MODULE_TYPELESS_PACKAGE_JSON warning (#3906)
Co-authored-by: Benoît Zugmeyer <[email protected]>
1 parent bab2fea commit e059b81

40 files changed

+137
-109
lines changed

‎developer-extension/tsconfig.webpack.json‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,14 @@
33

44
"compilerOptions": {
55
"baseUrl": ".",
6-
"module": "ES6",
6+
"module": "preserve",
77
"target": "esnext",
88
"jsx": "react",
99
"lib": ["ES2022", "DOM"],
1010
"types": ["chrome", "react", "react-dom", "jasmine"],
11-
"skipLibCheck": true
11+
"skipLibCheck": true,
12+
"allowImportingTsExtensions": true,
13+
"noEmit": true
1214
},
1315

1416
"include": ["src"]

‎eslint-local-rules/disallowEnumExports.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const { SymbolFlags } = require('typescript')
1+
import { SymbolFlags } from 'typescript'
22

33
/**
44
* This rule forbids exporting 'enums'. It serves two purposes:
@@ -34,7 +34,7 @@ const { SymbolFlags } = require('typescript')
3434
* [1]: https://www.typescriptlang.org/tsconfig#isolatedModules
3535
* [2]: https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-8.html#type-only-imports-and-export
3636
*/
37-
module.exports = {
37+
export default {
3838
meta: {
3939
docs: {
4040
description: 'Disallow export of enums.',

‎eslint-local-rules/disallowGenericUtils.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
const path = require('path')
1+
import path from 'path'
22

3-
module.exports = {
3+
export default {
44
meta: {
55
docs: {
66
description: 'Disallow the use of too generic utility file names',

‎eslint-local-rules/disallowNonScripts.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module.exports = {
1+
export default {
22
meta: {
33
docs: {
44
description: 'Disallow JS files that are not used as a "script"',

‎eslint-local-rules/disallowProtectedDirectoryImport.js‎

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
1-
const path = require('path')
2-
const { minimatch } = require('minimatch')
3-
const resolve = require('eslint-module-utils/resolve').default
4-
const moduleVisitor = require('eslint-module-utils/moduleVisitor').default
5-
const importType = require('eslint-plugin-import/lib/core/importType').default
1+
import path from 'node:path'
2+
import { minimatch } from 'minimatch'
63

7-
module.exports = {
4+
import resolvePackage from 'eslint-module-utils/resolve.js'
5+
import moduleVisitorPackage from 'eslint-module-utils/moduleVisitor.js'
6+
import importTypePackage from 'eslint-plugin-import/lib/core/importType.js'
7+
8+
const moduleVisitor = moduleVisitorPackage.default
9+
const importType = importTypePackage.default
10+
const resolve = resolvePackage.default
11+
12+
export default {
813
meta: {
914
docs: {
1015
description:

‎eslint-local-rules/disallowSideEffects.js‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
const path = require('path')
1+
import path from 'path'
22

3-
module.exports = {
3+
export default {
44
meta: {
55
docs: {
66
description:
@@ -22,7 +22,7 @@ module.exports = {
2222
},
2323
}
2424

25-
const packagesRoot = path.resolve(__dirname, '..', 'packages')
25+
const packagesRoot = path.resolve(import.meta.dirname, '..', 'packages')
2626

2727
// Those modules are known to have side effects when evaluated
2828
const pathsWithSideEffect = new Set([

‎eslint-local-rules/disallowSpecImport.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module.exports = {
1+
export default {
22
meta: {
33
docs: {
44
description: 'Disallow importing spec file code to avoid to execute the tests from the imported spec file twice',

‎eslint-local-rules/disallowTestImportExportFromSrc.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module.exports = {
1+
export default {
22
meta: {
33
docs: {
44
description:

‎eslint-local-rules/disallowUrlConstructorPatchValues.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module.exports = {
1+
export default {
22
meta: {
33
docs: {
44
description: 'Disallow problematic URL constructor patched values.',

0 commit comments

Comments
 (0)