File tree Expand file tree Collapse file tree 9 files changed +862
-56
lines changed Expand file tree Collapse file tree 9 files changed +862
-56
lines changed Original file line number Diff line number Diff line change 1818 run : npm install
1919 - name : Lint
2020 run : npm run lint
21+ build :
22+ runs-on : ubuntu-latest
23+ steps :
24+ - uses : actions/checkout@v2
25+ - uses : actions/setup-node@v2
26+ with :
27+ node-version : 14
28+ - name : Install Packages
29+ run : npm install
30+ - name : Build
31+ run : |+
32+ npm run update
33+ npm run build
2134 test :
2235 name : " Test for ESLint ${{ matrix.eslint }} on ${{ matrix.node }} OS: ${{matrix.os}}"
2336 runs-on : ${{ matrix.os }}
Original file line number Diff line number Diff line change 2323 "debug" : " mocha --require ts-node/register/transpile-only \" tests/src/**/*.ts\" --reporter dot --timeout 60000" ,
2424 "lint" : " eslint ." ,
2525 "eslint-fix" : " eslint . --fix" ,
26- "update" : " ts-node --transpile-only ./tools/update.ts && npm run eslint-fix && npm run test" ,
26+ "update" : " ts-node --transpile-only ./tools/update.ts && npm run format-for-gen-file" ,
27+ "format-for-gen-file" : " eslint src/types-for-node.ts src/utils/rules.ts src/configs --fix" ,
2728 "new" : " ts-node --transpile-only ./tools/new-rule.ts" ,
2829 "docs:watch" : " svelte-kit dev" ,
2930 "docs:build" : " node --experimental-loader ./svelte-kit-import-hook.mjs node_modules/@sveltejs/kit/svelte-kit.js build" ,
8081 "@types/eslint" : " ^8.0.0" ,
8182 "@types/eslint-scope" : " ^3.7.0" ,
8283 "@types/eslint-visitor-keys" : " ^1.0.0" ,
84+ "@types/estree" : " ^0.0.50" ,
8385 "@types/mocha" : " ^9.0.0" ,
8486 "@types/node" : " ^16.0.0" ,
8587 "@typescript-eslint/eslint-plugin" : " ^5.4.0" ,
Original file line number Diff line number Diff line change 11import type { AST } from "svelte-eslint-parser"
22import type * as ESTree from "estree"
33import type { TSESTree } from "@typescript-eslint/types"
4- import type { ASTNode } from "../../types"
54import type { IndentContext } from "./commons"
65import { getFirstAndLastTokens } from "./commons"
76import {
@@ -17,17 +16,9 @@ import {
1716 isOpeningParenToken ,
1817 isSemicolonToken ,
1918} from "eslint-utils"
19+ import type { ESNodeListener } from "../../types-for-node"
2020
21- type NodeWithParent =
22- | ( Exclude < ESTree . Node , ESTree . Program > & { parent : ASTNode } )
23- | AST . SvelteProgram
24- | AST . SvelteReactiveStatement
25-
26- type NodeListener = {
27- [ key in NodeWithParent [ "type" ] ] : (
28- node : NodeWithParent & { type : key } ,
29- ) => void
30- }
21+ type NodeListener = ESNodeListener
3122
3223/**
3324 * Creates AST event handlers for ES nodes.
Original file line number Diff line number Diff line change 11import type { AST } from "svelte-eslint-parser"
22import type { ASTNode } from "../../types"
3+ import type { SvelteNodeListener } from "../../types-for-node"
34import { isNotWhitespace } from "./ast"
45import type { IndentContext } from "./commons"
56import { isBeginningOfElement } from "./commons"
67import { isBeginningOfLine } from "./commons"
78import { getFirstAndLastTokens } from "./commons"
8- type NodeWithoutES = Exclude <
9- AST . SvelteNode ,
10- AST . SvelteProgram | AST . SvelteReactiveStatement
11- >
129
13- type NodeListener = {
14- [ key in NodeWithoutES [ "type" ] ] : ( node : NodeWithoutES & { type : key } ) => void
15- }
10+ type NodeListener = SvelteNodeListener
1611const PREFORMATTED_ELEMENT_NAMES = [ "pre" , "textarea" , "template" ]
1712
1813/**
Original file line number Diff line number Diff line change @@ -13,29 +13,9 @@ import {
1313import type { AnyToken , IndentContext } from "./commons"
1414import { isBeginningOfLine } from "./commons"
1515import { getFirstAndLastTokens } from "./commons"
16+ import type { TSNodeListener } from "../../types-for-node"
1617
17- type NodeWithoutES = Exclude <
18- TSESTree . Node ,
19- | { type : ESTree . Node [ "type" ] }
20- | TSESTree . JSXAttribute
21- | TSESTree . JSXClosingElement
22- | TSESTree . JSXClosingFragment
23- | TSESTree . JSXElement
24- | TSESTree . JSXEmptyExpression
25- | TSESTree . JSXExpressionContainer
26- | TSESTree . JSXFragment
27- | TSESTree . JSXIdentifier
28- | TSESTree . JSXMemberExpression
29- | TSESTree . JSXNamespacedName
30- | TSESTree . JSXOpeningElement
31- | TSESTree . JSXOpeningFragment
32- | TSESTree . JSXSpreadAttribute
33- | TSESTree . JSXSpreadChild
34- | TSESTree . JSXText
35- >
36- type NodeListener = {
37- [ key in NodeWithoutES [ "type" ] ] : ( node : NodeWithoutES & { type : key } ) => void
38- }
18+ type NodeListener = TSNodeListener
3919
4020/**
4121 * Creates AST event handlers for svelte nodes.
You can’t perform that action at this time.
0 commit comments