@swiftwc/eslint-plugin 1.1.1 → 1.1.3
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/generated/emberjs/en.js +1 -2
- package/generated/index.js +5 -3
- package/package.json +3 -3
- package/src/index.ts +7 -3
- package/tsconfig.json +1 -1
package/generated/emberjs/en.js
CHANGED
|
@@ -11,8 +11,7 @@ swiftwc.rules['allowed-tags'].create = (context) => {
|
|
|
11
11
|
const allowedParents = RULES[tag];
|
|
12
12
|
if (!allowedParents)
|
|
13
13
|
return; // 👈 ignore unknown tags completely
|
|
14
|
-
|
|
15
|
-
validate(tag, (item) => item.tag, allowedParents, context, node);
|
|
14
|
+
validate(tag, (item) => item.parent, allowedParents, context, node);
|
|
16
15
|
},
|
|
17
16
|
};
|
|
18
17
|
};
|
package/generated/index.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { readFileSync } from 'fs';
|
|
2
2
|
export const RULES = {
|
|
3
|
-
'v-keyboard': ['body'],
|
|
4
|
-
'scroll-view': ['body-view', 'dialog', 'navigation-stack', 'navigation-split-view', 'detail-placeholder'],
|
|
5
|
-
dialog: ['tab-view', '
|
|
3
|
+
'v-keyboard': ['template', 'body'],
|
|
4
|
+
'scroll-view': ['template', 'body-view', 'dialog', 'navigation-stack', 'navigation-split-view', 'detail-placeholder'],
|
|
5
|
+
dialog: ['template', 'tab-view', 'navigation-split-view'],
|
|
6
|
+
'tool-bar': ['template', 'body-view', 'navigation-split-view', 'navigation-stack'],
|
|
7
|
+
'tool-bar-item': ['template', 'tool-bar', 'tool-bar-item-group', 'sidebar-toggle'],
|
|
6
8
|
};
|
|
7
9
|
export function validate(tag, getParentTag, allowedParents, context, node) {
|
|
8
10
|
let parentTag = getParentTag(node), isValid = false;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@swiftwc/eslint-plugin",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.3",
|
|
4
4
|
"description": "Rules enforcing best practices while using SwiftWC.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint",
|
|
@@ -31,9 +31,9 @@
|
|
|
31
31
|
},
|
|
32
32
|
"scripts": {
|
|
33
33
|
"prebuild": "rm -rf generated",
|
|
34
|
-
"build": "npm run build:ts",
|
|
35
|
-
"build:ts:watch": "npm run prebuild && tsc --watch",
|
|
34
|
+
"build": "npm run format:write && npm run build:ts",
|
|
36
35
|
"build:ts": "tsc",
|
|
36
|
+
"start": "npm run prebuild && tsc --watch",
|
|
37
37
|
"format:check": "prettier . --check",
|
|
38
38
|
"format:write": "prettier . --write"
|
|
39
39
|
},
|
package/src/index.ts
CHANGED
|
@@ -8,11 +8,15 @@ export type TagNode = {
|
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
export const RULES: Record<string, string[]> = {
|
|
11
|
-
'v-keyboard': ['body'],
|
|
11
|
+
'v-keyboard': ['template', 'body'],
|
|
12
12
|
|
|
13
|
-
'scroll-view': ['body-view', 'dialog', 'navigation-stack', 'navigation-split-view', 'detail-placeholder'],
|
|
13
|
+
'scroll-view': ['template', 'body-view', 'dialog', 'navigation-stack', 'navigation-split-view', 'detail-placeholder'],
|
|
14
14
|
|
|
15
|
-
dialog: ['tab-view', '
|
|
15
|
+
dialog: ['template', 'tab-view', 'navigation-split-view'],
|
|
16
|
+
|
|
17
|
+
'tool-bar': ['template', 'body-view', 'navigation-split-view', 'navigation-stack'],
|
|
18
|
+
|
|
19
|
+
'tool-bar-item': ['template', 'tool-bar', 'tool-bar-item-group', 'sidebar-toggle'],
|
|
16
20
|
}
|
|
17
21
|
|
|
18
22
|
export function validate(
|
package/tsconfig.json
CHANGED