Skip to content

Commit

Permalink
feat(ts-codegenerator): add eslint config
Browse files Browse the repository at this point in the history
  • Loading branch information
ozhanefemeral committed Jul 23, 2024
1 parent 472d4c6 commit 249c595
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 11 deletions.
18 changes: 18 additions & 0 deletions packages/ts-generator/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/** @type {import("eslint").Linter.Config} */
module.exports = {
root: true,
extends: ["@repo/eslint-config/library.js"],
parser: "@typescript-eslint/parser",
parserOptions: {
project: "./tsconfig.json",
tsconfigRootDir: __dirname,
},
overrides: [
{
files: ["**/*.test.ts", "**/*.test.tsx"],
env: {
jest: true,
},
},
],
};
4 changes: 2 additions & 2 deletions packages/ts-generator/src/__tests__/codebase-scanner.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { scanCodebase } from "../codebase-scanner";
import { CodebaseInfo, FunctionInfo, TypeInfo } from "../types";
import * as path from "path";
import { scanCodebase } from "../codebase-scanner";
import { CodebaseInfo } from "../types";

describe("Codebase Scanner", () => {
it("should scan codebase", () => {
Expand Down
4 changes: 2 additions & 2 deletions packages/ts-generator/src/codebase-scanner.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Project, Node, Type, Symbol as TsSymbol } from "ts-morph";
import { FunctionInfo, TypeInfo, CodebaseInfo } from "./types";
import { Node, Project } from "ts-morph";
import { CodebaseInfo, FunctionInfo, TypeInfo } from "./types";

export function scanCodebase(projectPath: string): CodebaseInfo {
const project = new Project();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
import { Project, SyntaxKind } from "ts-morph";
import {
getFunctionInfoFromNode,
parseFunctionsFromFile,
parseFunctionsFromText,
} from "../parser";
import { getFunctionInfoFromNode, parseFunctionsFromText } from "../parser";

describe("Module Parser", () => {
describe("parseFunctionsFromText", () => {
Expand Down
4 changes: 2 additions & 2 deletions packages/ts-generator/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
"@/*": ["src/*"]
},
"jsx": "react-jsx",
"types": ["react", "react-dom", "node"]
"types": ["react", "react-dom", "node", "jest"]
},
"include": ["src/**/*"],
"exclude": ["node_modules", "**/*.spec.ts", "**/*.test.ts"]
"exclude": ["node_modules", "dist"]
}

0 comments on commit 249c595

Please sign in to comment.