@neovici/cfg 1.11.1 → 1.12.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.
package/eslint/index.js CHANGED
@@ -1,3 +1,5 @@
1
+ const path = require('path');
2
+
1
3
  module.exports = {
2
4
  env: {
3
5
  browser: true,
@@ -133,5 +135,10 @@ module.exports = {
133
135
  files: ['**/*.test.js'],
134
136
  extends: './test'
135
137
  }
136
- ]
138
+ ],
139
+ settings: {
140
+ 'import/resolver': {
141
+ [path.resolve(__dirname, 'node-enhanced.js')]: {},
142
+ }
143
+ }
137
144
  };
@@ -0,0 +1,26 @@
1
+ /* eslint-env node */
2
+ /* eslint-disable import/group-exports */
3
+ const { create } = require('enhanced-resolve'),
4
+ path = require('path'),
5
+ isCore = require('is-core-module');
6
+
7
+ let resolver;
8
+
9
+ exports.interfaceVersion = 2;
10
+
11
+ exports.resolve = (source, file, config = {}) => {
12
+ resolver = resolver || create.sync(config);
13
+ if (isCore(source)) {
14
+ return { found: true, path: null };
15
+ }
16
+
17
+ try {
18
+ const resolved = resolver({}, path.dirname(file), source);
19
+ return {
20
+ found: true,
21
+ path: resolved,
22
+ };
23
+ } catch (err) {
24
+ return { found: false };
25
+ }
26
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neovici/cfg",
3
- "version": "1.11.1",
3
+ "version": "1.12.2",
4
4
  "description": "Configuration for Neovici packages",
5
5
  "homepage": "https://github.com/Neovici/cfg#readme",
6
6
  "bugs": {
@@ -48,12 +48,14 @@
48
48
  "@babel/core": "^7.16.0",
49
49
  "@babel/eslint-parser": "^7.16.0",
50
50
  "@web/test-runner-playwright": "^0.8.8",
51
+ "enhanced-resolve": "^5.9.1",
51
52
  "eslint": "^8.2.0",
52
53
  "eslint-config-prettier": "^8.4.0",
53
54
  "eslint-import-resolver-alias": "^1.1.2",
54
55
  "eslint-plugin-html": "^6.2.0",
55
56
  "eslint-plugin-import": "^2.25.0",
56
57
  "eslint-plugin-mocha": "^10.0.0",
58
+ "is-core-module": "^2.8.1",
57
59
  "prettier": "^2.5.0"
58
60
  },
59
61
  "devDependencies": {
package/prettier/index.js CHANGED
@@ -1,4 +1,4 @@
1
1
  module.exports = {
2
- singleQuote: true,
3
- useTabs: true
4
- }
2
+ singleQuote: true,
3
+ useTabs: true,
4
+ };