You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There should be an example that shows how project works with the TypeScript flag. By default, if no project flag is passed and the files argument is an empty array, lynt will assume that project is in the current working directory . and will look for a tsconfig.json there.
importlyntfrom'lynt'constoptions={typescript: true}constresults=lynt([],options)// Will look for `./tsconfig.json` and use that to know which files to lint in the project.
A project option can be explicitly passed if tsconfig.json isn't in the current directory (like in ./config/tsconfig.json):
importlyntfrom'lynt'constoptions={typescript: true,project: './config'}constresults=lynt([],options)// Will look for `./config/tsconfig.json` and use that to know which files to lint in the project.
If files are given, a project flag should not be passed in (because it will just ignore the files and just use the tsconfig in the project to know which files to lint). However, passing files when using the typescript option will make you opt-out of some lint rules that require type information from the whole project, so passing in files is not recommended.
// Not recommendedimportlyntfrom'lynt'constfiles=['./foo.ts','./bar.ts']constoptions={typescript: true}constresults=lynt(files,options)
The text was updated successfully, but these errors were encountered:
Yea i was wondering about that option and know kinda understand what is about, so consider to rename it? Might make more sense to be such as tsroot, typescript-root, tsconfig-root or whatever.. don't know exactly.
Those might be more explicit, but I want to keep the name project because it will be familiar to TSLint users. The flag for giving a path to your tsconfig.json with TSLint is also called --projecthttps://palantir.github.io/tslint/usage/cli/#cli-usage
The current API docs: https://github.com/saadq/lynt#api
There should be an example that shows how
project
works with the TypeScript flag. By default, if noproject
flag is passed and thefiles
argument is an empty array,lynt
will assume thatproject
is in the current working directory.
and will look for atsconfig.json
there.A
project
option can be explicitly passed iftsconfig.json
isn't in the current directory (like in./config/tsconfig.json
):If
files
are given, aproject
flag should not be passed in (because it will just ignore thefiles
and just use the tsconfig in theproject
to know which files to lint). However, passingfiles
when using thetypescript
option will make you opt-out of some lint rules that require type information from the whole project, so passing infiles
is not recommended.The text was updated successfully, but these errors were encountered: