tbonelee commented on PR #5054:
URL: https://github.com/apache/zeppelin/pull/5054#issuecomment-3240181161
Could you please rebase this branch onto `master`?
Also, while reviewing, I noticed two items that might be worth
double-checking:
1. `src/**/*.ts` excluded from linting
From what I can tell, `src/tslint.json` extends the root `tslint.json`, and
the root's `linterOptions.exclude` seems to include `src/**/*.ts`. With the
currnet configuration, I wasn't seeing lint errors for files under that path.
2. `--project` value
The TSLint CLI does indicate `--project` should point to a `tsconfig` rather
than `tslint.json`. In my quick local check, passing `-p src/tslint.json`
didn't enable type-aware rules (so some issues didnt' surface), whereas `-p
src/tsconifg.app.json` did.
Minimal repro:
- Remove the `linterOptions.exclude` entry so that `src/**/*.ts` are not
excluded.
- Add:
```ts
// src/app/arr.ts
export const strs: string[] = [];
```
```ts
// src/app/for-in.ts
import { strs } from '@zeppelin/arr'; // use path alias so type info is
needed
// Should trigger no-for-in-array
for (const s in strs) console.log(s);
```
- Results:
- `npx tslint src/app/for-in.ts` -> warnings: "requires type information".
- `npx tslint -p src/tslint.json src/app/for-in.ts` -> no warnings, no
errors (Maybe it was recognized as empty tsconfig file.)
- `npx tslint -p src/tsconfig.app.json src/app/for-in.ts` -> `ERROR:
for-in loops over arrays are forbidden...`
### Tentative proposal (very open to correction):
Maybe we could use `ng lint --fix` to correct project-overall lint errors.
Using this, we could ignore improper directories (`node_modules`, etc.) and
lint for overall project codes automatically. If we add some other new
directories(e.g., `custom-rules`) that we want to lint, then they should be
added into `angular.json` as a new project. It could not check root-level `.ts`
files, but I think they do not exist for now and it could be ignored for
linting because those would be just some configurations.
Apologies for the long comments. My checks were somewhat inductive, so I
might have drawn the wrong conclusions. I mainly wanted to see whether the
previous code intentionally relied on passing `tslint.json` to `--project` (and
whether that has any effect). If I've missed something, please correct me so we
can wrap this up properly — and I'm open to any other suggestions as well.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]