Skip to content

Commit

Permalink
Merge PR #83 from YuMuuu: Add Prettier check setting
Browse files Browse the repository at this point in the history
add prettier check setting
  • Loading branch information
nene authored Jul 8, 2024
2 parents e2f99d3 + 359cedf commit 734ae77
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking"
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"prettier"
],
"overrides": [],
"parser": "@typescript-eslint/parser",
Expand Down
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/lib
/node_modules
/src/dialects/*.js
/src/parser.ts
changelog.hbs
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
"auto-changelog": "^2.4.0",
"benchmark": "^2.1.4",
"eslint": "^8.30.0",
"eslint-config-prettier": "^9.1.0",
"jest": "^29.1.2",
"npm-watch": "^0.11.0",
"peggy": "^3.0.2",
Expand Down
2 changes: 1 addition & 1 deletion src/cstTransformer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export type TransformMap<T, TNode extends Node = Node> = Partial<
export function cstTransformer<T>(map: TransformMap<T>): (node: Node) => T {
return (node: Node) => {
const fn = map[node.type] as (
param: NodeByType<typeof node["type"], Node>
param: NodeByType<(typeof node)["type"], Node>
) => T;
if (!fn) {
if (!node.type) {
Expand Down
2 changes: 1 addition & 1 deletion src/cstVisitor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export type FullVisitorMap = {
export function cstVisitor(map: Partial<FullVisitorMap>): (node: Node) => void {
const visit = (node: Node) => {
const visitType = map[node.type] as (
e: Extract<Node, { type: typeof node["type"] }>
e: Extract<Node, { type: (typeof node)["type"] }>
) => VisitorAction | void;

// Visit the node itself
Expand Down
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1342,6 +1342,11 @@ escape-string-regexp@^4.0.0:
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34"
integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==

eslint-config-prettier@^9.1.0:
version "9.1.0"
resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-9.1.0.tgz#31af3d94578645966c082fcb71a5846d3c94867f"
integrity sha512-NSWl5BFQWEPi1j4TjVNItzYV7dZXZ+wP6I6ZhrBGpChQhZRUaElihE9uRRkcbRnNb76UMKDF3r+WTmNcGPKsqw==

eslint-scope@^5.1.1:
version "5.1.1"
resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.1.1.tgz#e786e59a66cb92b3f6c1fb0d508aab174848f48c"
Expand Down

0 comments on commit 734ae77

Please sign in to comment.