File tree 3 files changed +38
-1
lines changed
3 files changed +38
-1
lines changed Original file line number Diff line number Diff line change @@ -12,4 +12,12 @@ module.exports = {
12
12
rules : {
13
13
'prettier/prettier' : 'error' ,
14
14
} ,
15
+ overrides : [
16
+ {
17
+ files : [ '**/*.cjs' ] ,
18
+ parserOptions : {
19
+ sourceType : 'script' ,
20
+ } ,
21
+ } ,
22
+ ] ,
15
23
} ;
Original file line number Diff line number Diff line change
1
+ // this will be populated inside the static `isEnabled` method just below
2
+ let RealPlugin ;
3
+
4
+ module . exports = class FakeCJSWrapperPlugin {
5
+ static async isEnabled ( ) {
6
+ // we use the async of this method to enable us to absorb the dynamic
7
+ // import statement
8
+
9
+ // dynamic `import()` statements work on Node ^12.17.0 and >= 14; which
10
+ // is within our support range; we can remove this inline disable
11
+ // when https://github.com/mysticatea/eslint-plugin-node/pull/256 (or another
12
+ // PR like it) lands
13
+
14
+ // eslint-disable-next-line node/no-unsupported-features/es-syntax
15
+ let RealPluginModule = await import ( './index.js' ) ;
16
+ RealPlugin = RealPluginModule . default ;
17
+ }
18
+
19
+ constructor ( ...args ) {
20
+ // now we just use the "real plugin" as is
21
+ return new RealPlugin ( ...args ) ;
22
+ }
23
+ } ;
Original file line number Diff line number Diff line change 43
43
"release-it" : " ^14.11.6" ,
44
44
"sinon" : " ^11.1.2"
45
45
},
46
+ "exports" : {
47
+ "." : {
48
+ "import" : " ./index.js" ,
49
+ "require" : " ./cjs-wrapper.cjs"
50
+ }
51
+ },
46
52
"peerDependencies" : {
47
53
"release-it" : " ^14.0.0"
48
54
},
54
60
},
55
61
"release-it" : {
56
62
"plugins" : {
57
- "./index.js " : {
63
+ "./cjs-wrapper.cjs " : {
58
64
"infile" : " CHANGELOG.md" ,
59
65
"launchEditor" : true
60
66
}
You can’t perform that action at this time.
0 commit comments