@ember-intl/utils 0.3.0 → 0.5.0
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.
|
@@ -5,21 +5,21 @@ import { findUserConfig } from './find-user-config.js';
|
|
|
5
5
|
import { getDefaultConfig } from './get-default-config.js';
|
|
6
6
|
function validate(userConfig) {
|
|
7
7
|
if (userConfig === undefined) {
|
|
8
|
-
|
|
8
|
+
throw new Error('missing default export');
|
|
9
9
|
}
|
|
10
10
|
const defaultConfig = getDefaultConfig();
|
|
11
11
|
if (userConfig.buildOptions) {
|
|
12
12
|
const buildOptions = new Set(Object.keys(defaultConfig.buildOptions));
|
|
13
13
|
Object.keys(userConfig.buildOptions).forEach((buildOption) => {
|
|
14
14
|
if (!buildOptions.has(buildOption)) {
|
|
15
|
-
throw new Error(`
|
|
15
|
+
throw new Error(`unknown build option: ${buildOption}`);
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
18
|
}
|
|
19
19
|
if (userConfig.lintRules) {
|
|
20
20
|
Object.keys(userConfig.lintRules).forEach((lintRule) => {
|
|
21
21
|
if (!lintRules.includes(lintRule)) {
|
|
22
|
-
throw new Error(`
|
|
22
|
+
throw new Error(`unknown lint rule: ${lintRule}`);
|
|
23
23
|
}
|
|
24
24
|
});
|
|
25
25
|
}
|
|
@@ -38,7 +38,7 @@ export async function getUserConfig(projectRoot) {
|
|
|
38
38
|
return userConfig;
|
|
39
39
|
}
|
|
40
40
|
catch (error) {
|
|
41
|
-
throw new Error(`
|
|
41
|
+
throw new Error(`Unable to get ember-intl config (${error.message})`, {
|
|
42
42
|
cause: error,
|
|
43
43
|
});
|
|
44
44
|
}
|
package/dist/config.d.ts
CHANGED
package/dist/config.js
CHANGED