Skip to content
This repository was archived by the owner on Mar 7, 2025. It is now read-only.

Commit ff6bd71

Browse files
sxzzShinigami92
andauthored
feat: support flat config (#145)
Co-authored-by: Shinigami92 <[email protected]>
1 parent ec9cf53 commit ff6bd71

29 files changed

+339
-110
lines changed

.eslintrc.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ module.exports = defineConfig({
66
ignorePatterns: [
77
...readGitignoreFiles(),
88
'src/index.js',
9+
'src/index.mjs',
910
'.eslintrc.js', // Skip self linting
1011
],
1112
root: true,

src/env.d.ts renamed to src/config/env.d.ts

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,110 +8,137 @@ export interface Environments extends Partial<Record<string, boolean>> {
88
* Browser global variables.
99
*/
1010
browser?: boolean;
11+
1112
/**
1213
* Node.js global variables and Node.js scoping.
1314
*/
1415
node?: boolean;
16+
1517
/**
1618
* CommonJS global variables and CommonJS scoping (use this for browser-only code that uses Browserify/WebPack).
1719
*/
1820
commonjs?: boolean;
21+
1922
/**
2023
* Globals common to both Node.js and Browser.
2124
*/
2225
'shared-node-browser'?: boolean;
26+
2327
/**
2428
* Enable all ECMAScript 6 features except for modules (this automatically sets the ecmaVersion parser option to 6).
2529
*/
2630
es6?: boolean;
31+
2732
/**
2833
* Adds all ECMAScript 2017 globals and automatically sets the ecmaVersion parser option to 8.
2934
*/
3035
es2017?: boolean;
36+
3137
/**
3238
* Adds all ECMAScript 2020 globals and automatically sets the ecmaVersion parser option to 11.
3339
*/
3440
es2020?: boolean;
41+
3542
/**
3643
* Adds all ECMAScript 2021 globals and automatically sets the ecmaVersion parser option to 12.
3744
*/
3845
es2021?: boolean;
46+
3947
/**
4048
* Web workers global variables.
4149
*/
4250
worker?: boolean;
51+
4352
/**
4453
* Defines `require()` and `define()` as global variables as per the amd spec.
4554
*/
4655
amd?: boolean;
56+
4757
/**
4858
* Adds all of the Mocha testing global variables.
4959
*/
5060
mocha?: boolean;
61+
5162
/**
5263
* Adds all of the Jasmine testing global variables for version 1.3 and 2.0.
5364
*/
5465
jasmine?: boolean;
66+
5567
/**
5668
* Jest global variables.
5769
*/
5870
jest?: boolean;
71+
5972
/**
6073
* PhantomJS global variables.
6174
*/
6275
phantomjs?: boolean;
76+
6377
/**
6478
* Protractor global variables.
6579
*/
6680
protractor?: boolean;
81+
6782
/**
6883
* QUnit global variables.
6984
*/
7085
qunit?: boolean;
86+
7187
/**
7288
* jQuery global variables.
7389
*/
7490
jquery?: boolean;
91+
7592
/**
7693
* Prototype.js global variables.
7794
*/
7895
prototypejs?: boolean;
96+
7997
/**
8098
* ShellJS global variables.
8199
*/
82100
shelljs?: boolean;
101+
83102
/**
84103
* Meteor global variables.
85104
*/
86105
meteor?: boolean;
106+
87107
/**
88108
* MongoDB global variables.
89109
*/
90110
mongo?: boolean;
111+
91112
/**
92113
* AppleScript global variables.
93114
*/
94115
applescript?: boolean;
116+
95117
/**
96118
* Java 8 Nashorn global variables.
97119
*/
98120
nashorn?: boolean;
121+
99122
/**
100123
* Service Worker global variables.
101124
*/
102125
serviceworker?: boolean;
126+
103127
/**
104128
* Atom test helper globals.
105129
*/
106130
atomtest?: boolean;
131+
107132
/**
108133
* Ember test helper globals.
109134
*/
110135
embertest?: boolean;
136+
111137
/**
112138
* WebExtensions globals.
113139
*/
114140
webextensions?: boolean;
141+
115142
/**
116143
* GreaseMonkey globals.
117144
*/

0 commit comments

Comments
 (0)