sgb-io / fta

Rust-based static analysis for TypeScript projects

Home Page:https://ftaproject.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Config file ignored

zettadam opened this issue · comments

Hi,

I have installed fta-cli@1.0.0 on my MacBook. I want to run static analysis on code in a project, but not on any tests, documentation or Storybook stories, etc. that are placed near source code.

Here is my fta.json file that is completely ignored by fta running from npm script in package.json, npm run --config-path="./fta.json":

{
  "output_limit": 5000,
  "score_cap": 1000,
  "include_comments": false,
  "exclude_under": 6,
  "exclude_directories": [],
  "exclude_filenames": [
    ".spec.jsx",
    ".stories.tsx",
    ".docs.mdx",
    ".types.ts",
    ".d.ts"
  ],
  "extensions": [
    ".js",
    ".jsx",
    ".ts",
    ".tsx"
  ]
}

My fta.json is located in the root of the project and according to documentation it should be picked up automatically, but it does not. Specifying --config-path does not help. I want to ignore any .spec, .docs or. stories, or .types files included in src but this is the output I get:

ftp-output-head

I tried changing other configuration in the file, like output_limit but they get ignored, too.

Hi @zettadam thanks for reporting. This might be due to some quirkiness of how the exclude/extensions options work.

Do you still have the problem if you clear out extensions? It seems like something is overriding your exclusions. You could also try values like *.spec.jsx (including the asterisks) to see if it changes the result.