@commercetools-frontend/eslint-config-mc-app 20.8.0 → 20.10.6
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/CHANGELOG.md +73 -0
- package/index.js +14 -2
- package/package.json +2 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,78 @@
|
|
|
1
1
|
# @commercetools-frontend/eslint-config-mc-app
|
|
2
2
|
|
|
3
|
+
## 20.10.6
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#2386](https://github.com/commercetools/merchant-center-application-kit/pull/2386) [`d7fcf6fc`](https://github.com/commercetools/merchant-center-application-kit/commit/d7fcf6fc8495d4eae68e0a4f4c1f1b3e0e394454) Thanks [@emmenko](https://github.com/emmenko)! - Upgrade to Yarn v3
|
|
8
|
+
|
|
9
|
+
## 20.10.1
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#2356](https://github.com/commercetools/merchant-center-application-kit/pull/2356) [`e34fe076`](https://github.com/commercetools/merchant-center-application-kit/commit/e34fe076aab6681cdcc54622d84123f2c22020e6) Thanks [@ByronDWall](https://github.com/ByronDWall)! - set node version to 16.8 in nvmrc to avoid a bug in node/v8
|
|
14
|
+
|
|
15
|
+
## 20.9.3
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- [#2318](https://github.com/commercetools/merchant-center-application-kit/pull/2318) [`83f2add2`](https://github.com/commercetools/merchant-center-application-kit/commit/83f2add2a56ba6696c51fd930a0a1dadbf36c134) Thanks [@renovate](https://github.com/apps/renovate)! - Update all dependencies
|
|
20
|
+
|
|
21
|
+
## 20.9.0
|
|
22
|
+
|
|
23
|
+
### Minor Changes
|
|
24
|
+
|
|
25
|
+
- [#2317](https://github.com/commercetools/merchant-center-application-kit/pull/2317) [`487fcca6`](https://github.com/commercetools/merchant-center-application-kit/commit/487fcca6bcc03a4df59830e5204ca89cc5395df4) Thanks [@emmenko](https://github.com/emmenko)! - Add support for defining the Custom Application config as JS files.
|
|
26
|
+
|
|
27
|
+
Until now a Custom Application config file had to be defined as a JSON file with one of the following names:
|
|
28
|
+
|
|
29
|
+
- `.custom-application-configrc`
|
|
30
|
+
- `.custom-application-config.json`
|
|
31
|
+
- `custom-application-config.json`
|
|
32
|
+
|
|
33
|
+
On top of that, we built some "syntax features" to allow [variable placeholders](https://docs.commercetools.com/custom-applications/development/application-config#using-variable-placeholders) as a way to inject dynamic information into the static configuration file.
|
|
34
|
+
|
|
35
|
+
However, there are still some use cases where the information you need to provide must be imported from another file, for example a constants file or something similar.
|
|
36
|
+
|
|
37
|
+
To support such use cases, we now allow additional JS files to be used as a Custom Application config, specifically the following file extensions:
|
|
38
|
+
|
|
39
|
+
- `.js`
|
|
40
|
+
- `.cjs`
|
|
41
|
+
- `.mjs`
|
|
42
|
+
- `.ts`
|
|
43
|
+
|
|
44
|
+
The file must obviously return the configuration object.
|
|
45
|
+
|
|
46
|
+
> NOTE that you can still use variable placeholders.
|
|
47
|
+
|
|
48
|
+
For example:
|
|
49
|
+
|
|
50
|
+
```js
|
|
51
|
+
// constants.js
|
|
52
|
+
const entryPointUriPath = 'test';
|
|
53
|
+
module.exports = { entryPointUriPath };
|
|
54
|
+
|
|
55
|
+
// custom-application-config.js
|
|
56
|
+
const { entryPointUriPath } = require('./constants');
|
|
57
|
+
|
|
58
|
+
const name = 'Test application';
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* @type {import('@commercetools-frontend/application-config').ConfigOptions}
|
|
62
|
+
*/
|
|
63
|
+
const config = {
|
|
64
|
+
name,
|
|
65
|
+
cloudIdentifier: 'gcp-eu',
|
|
66
|
+
entryPointUriPath,
|
|
67
|
+
env: {
|
|
68
|
+
production: {
|
|
69
|
+
url: '${env:APP_URL}',
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
};
|
|
73
|
+
module.exports = config;
|
|
74
|
+
```
|
|
75
|
+
|
|
3
76
|
## 20.8.0
|
|
4
77
|
|
|
5
78
|
### Patch Changes
|
package/index.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
const { statusCode, allSupportedExtensions } = require('./helpers/eslint');
|
|
2
2
|
const hasJsxRuntime = require('./helpers/has-jsx-runtime');
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* @type {import("eslint").Linter.Config}
|
|
6
|
+
*/
|
|
4
7
|
module.exports = {
|
|
5
8
|
extends: [
|
|
6
9
|
// https://github.com/facebook/create-react-app/tree/master/packages/eslint-config-react-app
|
|
@@ -30,7 +33,7 @@ module.exports = {
|
|
|
30
33
|
],
|
|
31
34
|
rules: {
|
|
32
35
|
// NOTE: The regular rule does not support do-expressions. The equivalent rule of babel does.
|
|
33
|
-
'no-unused-expressions':
|
|
36
|
+
'no-unused-expressions': statusCode.off,
|
|
34
37
|
|
|
35
38
|
// Imports
|
|
36
39
|
'import/extensions': [
|
|
@@ -110,7 +113,7 @@ module.exports = {
|
|
|
110
113
|
'@typescript-eslint/ban-ts-comment': statusCode.off,
|
|
111
114
|
'@typescript-eslint/explicit-function-return-type': statusCode.off,
|
|
112
115
|
'@typescript-eslint/explicit-member-accessibility': [
|
|
113
|
-
|
|
116
|
+
statusCode.error,
|
|
114
117
|
{ accessibility: 'no-public' },
|
|
115
118
|
],
|
|
116
119
|
'@typescript-eslint/no-require-imports': statusCode.off,
|
|
@@ -136,5 +139,14 @@ module.exports = {
|
|
|
136
139
|
},
|
|
137
140
|
},
|
|
138
141
|
},
|
|
142
|
+
{
|
|
143
|
+
files: [
|
|
144
|
+
'.custom-application-config.{js,cjs,mjs,ts}',
|
|
145
|
+
'custom-application-config.{js,cjs,mjs,ts}',
|
|
146
|
+
],
|
|
147
|
+
rules: {
|
|
148
|
+
'no-template-curly-in-string': statusCode.off,
|
|
149
|
+
},
|
|
150
|
+
},
|
|
139
151
|
],
|
|
140
152
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commercetools-frontend/eslint-config-mc-app",
|
|
3
|
-
"version": "20.
|
|
3
|
+
"version": "20.10.6",
|
|
4
4
|
"description": "ESLint config used by a Custom Application.",
|
|
5
5
|
"bugs": "https://github.com/commercetools/merchant-center-application-kit/issues",
|
|
6
6
|
"repository": {
|
|
@@ -11,11 +11,9 @@
|
|
|
11
11
|
"homepage": "https://docs.commercetools.com/custom-applications",
|
|
12
12
|
"keywords": ["javascript", "frontend", "react", "toolkit", "eslint"],
|
|
13
13
|
"license": "MIT",
|
|
14
|
-
"private": false,
|
|
15
14
|
"publishConfig": {
|
|
16
15
|
"access": "public"
|
|
17
16
|
},
|
|
18
|
-
"scripts": {},
|
|
19
17
|
"dependencies": {
|
|
20
18
|
"@typescript-eslint/eslint-plugin": "^4.14.0",
|
|
21
19
|
"@typescript-eslint/parser": "^4.14.0",
|
|
@@ -39,6 +37,6 @@
|
|
|
39
37
|
"eslint": ">=7.0.0"
|
|
40
38
|
},
|
|
41
39
|
"devDependencies": {
|
|
42
|
-
"eslint": "7.
|
|
40
|
+
"eslint": "7.32.0"
|
|
43
41
|
}
|
|
44
42
|
}
|