@bedrockio/eslint-plugin 1.2.1 → 1.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -10,10 +10,17 @@ var _importRules = _interopRequireDefault(require("./importRules.js"));
10
10
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
11
11
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
12
12
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
13
- const file = _path.default.join(process.cwd(), 'vite.config.js');
14
- const {
15
- default: viteConfig
16
- } = await (specifier => new Promise(r => r(`${specifier}`)).then(s => _interopRequireWildcard(require(s))))(file);
13
+ let viteConfig;
14
+ try {
15
+ const file = _path.default.join(process.cwd(), 'vite.config.js');
16
+ const {
17
+ default: config
18
+ } = await (specifier => new Promise(r => r(`${specifier}`)).then(s => _interopRequireWildcard(require(s))))(file);
19
+ viteConfig = config;
20
+ } catch {
21
+ // Config file does not exist or
22
+ // top-level await not supported.
23
+ }
17
24
  var _default = exports.default = {
18
25
  ...plugin.flatConfigs.recommended,
19
26
  files: ['**/*.{js,jsx,ts,tsx}'],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bedrockio/eslint-plugin",
3
- "version": "1.2.1",
3
+ "version": "1.2.2",
4
4
  "description": "Common ESLint plugin for Bedrock projects.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -2,8 +2,16 @@ import path from 'path';
2
2
  import * as plugin from 'eslint-plugin-import';
3
3
  import importRules from './importRules.js';
4
4
 
5
- const file = path.join(process.cwd(), 'vite.config.js');
6
- const { default: viteConfig } = await import(file);
5
+ let viteConfig;
6
+
7
+ try {
8
+ const file = path.join(process.cwd(), 'vite.config.js');
9
+ const { default: config } = await import(file);
10
+ viteConfig = config;
11
+ } catch {
12
+ // Config file does not exist or
13
+ // top-level await not supported.
14
+ }
7
15
 
8
16
  export default {
9
17
  ...plugin.flatConfigs.recommended,