@channel.io/stylelint-bezier 0.2.11-beta.0 → 0.2.11-beta.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/.turbo/turbo-build.log
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
9:26:28 AM - Projects in this build:
|
|
2
2
|
* tsconfig.json
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
9:26:28 AM - Project 'tsconfig.json' is out of date because output file 'dist/tsconfig.tsbuildinfo' does not exist
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
9:26:28 AM - Building project '/home/runner/work/bezier-react/bezier-react/packages/stylelint-bezier/tsconfig.json'...
|
|
7
7
|
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @channel.io/stylelint-bezier
|
|
2
2
|
|
|
3
|
+
## 0.2.11-beta.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Restrict stylelint-bezier to validate only v3 tokens to detect migration omissions during development. ([#2742](https://github.com/channel-io/bezier-react/pull/2742)) by @timok1m
|
|
8
|
+
|
|
9
|
+
## 0.2.11-beta.1
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Update stylelint to cover v3 token ([#2735](https://github.com/channel-io/bezier-react/pull/2735)) by @timok1m
|
|
14
|
+
|
|
3
15
|
## 0.2.11-beta.0
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -4,48 +4,33 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.rule = exports.messages = exports.ruleName = void 0;
|
|
7
|
-
const
|
|
8
|
-
const alpha_1 = require("@channel.io/bezier-tokens/alpha");
|
|
7
|
+
const beta_1 = require("@channel.io/bezier-tokens/beta");
|
|
9
8
|
const stylelint_1 = __importDefault(require("stylelint"));
|
|
10
9
|
const { utils: { report, ruleMessages, validateOptions }, createPlugin, } = stylelint_1.default;
|
|
11
10
|
function isString(value) {
|
|
12
11
|
return typeof value === 'string';
|
|
13
12
|
}
|
|
14
|
-
function
|
|
15
|
-
for (const [key, value] of Object.entries(obj)) {
|
|
16
|
-
if (typeof value === 'object' && value !== null && !Array.isArray(value)) {
|
|
17
|
-
flattenObject(value, result);
|
|
18
|
-
}
|
|
19
|
-
else {
|
|
20
|
-
result[key] = value;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
return result;
|
|
24
|
-
}
|
|
25
|
-
function flattenAlphaToken(obj, result = {}) {
|
|
13
|
+
function flattenBetaToken(obj, result = {}) {
|
|
26
14
|
for (const [key, value] of Object.entries(obj)) {
|
|
27
15
|
if (typeof value === 'object' &&
|
|
28
16
|
value !== null &&
|
|
17
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
29
18
|
value.value !== undefined &&
|
|
30
19
|
!Array.isArray(value)) {
|
|
20
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
31
21
|
result[key] = value.value;
|
|
32
22
|
}
|
|
33
23
|
else if (typeof value === 'object' &&
|
|
34
24
|
value !== null &&
|
|
35
25
|
!Array.isArray(value)) {
|
|
36
|
-
|
|
37
|
-
}
|
|
38
|
-
else {
|
|
39
|
-
result[key] = value.value;
|
|
26
|
+
flattenBetaToken(value, result);
|
|
40
27
|
}
|
|
41
28
|
}
|
|
42
29
|
return result;
|
|
43
30
|
}
|
|
44
31
|
const allTokens = {
|
|
45
|
-
...
|
|
46
|
-
...
|
|
47
|
-
...flattenAlphaToken(alpha_1.tokens.global),
|
|
48
|
-
...flattenAlphaToken(alpha_1.tokens.lightTheme),
|
|
32
|
+
...flattenBetaToken(beta_1.tokens.global),
|
|
33
|
+
...flattenBetaToken(beta_1.tokens.lightTheme),
|
|
49
34
|
};
|
|
50
35
|
const ruleName = 'bezier/validate-token';
|
|
51
36
|
exports.ruleName = ruleName;
|
package/package.json
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { tokens } from '@channel.io/bezier-tokens'
|
|
2
|
-
import { tokens as alphaTokens } from '@channel.io/bezier-tokens/alpha'
|
|
1
|
+
import { tokens as betaTokens } from '@channel.io/bezier-tokens/beta'
|
|
3
2
|
import stylelint, { type Rule } from 'stylelint'
|
|
4
3
|
|
|
5
4
|
const {
|
|
@@ -11,44 +10,32 @@ function isString(value: unknown): value is string {
|
|
|
11
10
|
return typeof value === 'string'
|
|
12
11
|
}
|
|
13
12
|
|
|
14
|
-
function
|
|
15
|
-
for (const [key, value] of Object.entries(obj)) {
|
|
16
|
-
if (typeof value === 'object' && value !== null && !Array.isArray(value)) {
|
|
17
|
-
flattenObject(value, result)
|
|
18
|
-
} else {
|
|
19
|
-
result[key] = value
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
return result
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
function flattenAlphaToken(obj: object, result: Record<string, unknown> = {}) {
|
|
13
|
+
function flattenBetaToken(obj: object, result: Record<string, unknown> = {}) {
|
|
26
14
|
for (const [key, value] of Object.entries(obj)) {
|
|
27
15
|
if (
|
|
28
16
|
typeof value === 'object' &&
|
|
29
17
|
value !== null &&
|
|
30
|
-
|
|
18
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
19
|
+
(value as any).value !== undefined &&
|
|
31
20
|
!Array.isArray(value)
|
|
32
21
|
) {
|
|
33
|
-
|
|
22
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
23
|
+
result[key] = (value as any).value
|
|
34
24
|
} else if (
|
|
35
25
|
typeof value === 'object' &&
|
|
36
26
|
value !== null &&
|
|
37
27
|
!Array.isArray(value)
|
|
38
28
|
) {
|
|
39
|
-
|
|
40
|
-
} else {
|
|
41
|
-
result[key] = value.value
|
|
29
|
+
flattenBetaToken(value, result)
|
|
42
30
|
}
|
|
43
31
|
}
|
|
32
|
+
|
|
44
33
|
return result
|
|
45
34
|
}
|
|
46
35
|
|
|
47
36
|
const allTokens = {
|
|
48
|
-
...
|
|
49
|
-
...
|
|
50
|
-
...flattenAlphaToken(alphaTokens.global),
|
|
51
|
-
...flattenAlphaToken(alphaTokens.lightTheme),
|
|
37
|
+
...flattenBetaToken(betaTokens.global),
|
|
38
|
+
...flattenBetaToken(betaTokens.lightTheme),
|
|
52
39
|
}
|
|
53
40
|
|
|
54
41
|
const ruleName = 'bezier/validate-token'
|