Open mehmetnyarar opened 4 years ago
I guess you forgot ;
?
I'm having this issue as well, with static modifiers and whatnot:
Is this package expected to work with TypeScript or not?
I assumed it was because it includes @typescript-eslint/parser
, but then in the ignoring files section it has the example of ignoring **/*.ts
, so now I'm not sure.
it works in my case, what's your typescript and prettier-standard version in package.json? how do you run it?
You are correct. I figured out that my issue was with eslint. static
's can't be private.
I'm having the same issues as the OP. There's actually a couple of different scenarios:
Combinations of:
pretter-standard@16.4.1
typescript@4.0.2
@typescript-eslint/parser@4.0.1
or
pretter-standard@16.4.1
typescript@3.9.7
@typescript-eslint/parser@3.0.0
Results in eslint parsing errors.
Rolling back to 16.3.0 resolves my issue.
Encountered the same problem today, and can also confirm rolling back to 16.3.0 seems to resolve it. In my case it seems to be choking on this:
export type ThrowableType = new () => Error
Which results in:
5:33 error Parsing error: Unexpected token, expected ";"
3 | * used when specifying which type of error will be caught.
4 | */
> 5 | export type ThrowableType = new () => Error
| ^
6 |
7 | /**
8 | * A function containing the code to be executed as part of a try block
✖ 1 problem (1 error, 0 warnings)
This behavior can be observed in the public repo I'm working in here (running yarn lint
will reproduce the issue).
Came here because of the same types of problems.
15:3 error Parsing error: Unexpected token
13 | export interface testConnInfo {
14 | db?: Connection
> 15 | redis?: Redis.Redis
| ^
16 | }
or
191:25 error Parsing error: Unexpected token, expected ","
189 | })
190 |
> 191 | expect(response.data!.users!).toHaveLength(4)
| ^
192 |
193 | // TODO: verify the 4 users we want to see
194 | })
or
47:27 error Parsing error: Unexpected token, expected ";"
45 | beforeAll(async () => {
46 | connInfo = await testConnOpen()
> 47 | redis = connInfo.redis!
| ^
48 | userRepository = getRepository(User)
49 | })
50 |
problems occur with 16.4.1
, 16.4.0
(how come neither of these are tagged in github master repo?)
All of them go away when you revert to 16.3.0
the last repo tagged version.
When setting parserOptions.project
for typescript in the eslint config I also have the problem that prettier-standard seem to have issues picking up the config.
Error: Error while loading rule '@typescript-eslint/await-thenable': You have used a rule which requires parserServices to be generated. You must therefore provide a value for the "parserOptions.project" property for @typescript-eslint/parser.
Occurred while linting /Users/einselbst/Workspace/einselbst/feehikel/src/pages/_app.tsx
Rolling back to 16.3.0
does also fix this issue.
Came here because of the same types of problems.
15:3 error Parsing error: Unexpected token 13 | export interface testConnInfo { 14 | db?: Connection > 15 | redis?: Redis.Redis | ^ 16 | }
or
191:25 error Parsing error: Unexpected token, expected "," 189 | }) 190 | > 191 | expect(response.data!.users!).toHaveLength(4) | ^ 192 | 193 | // TODO: verify the 4 users we want to see 194 | })
or
47:27 error Parsing error: Unexpected token, expected ";" 45 | beforeAll(async () => { 46 | connInfo = await testConnOpen() > 47 | redis = connInfo.redis! | ^ 48 | userRepository = getRepository(User) 49 | }) 50 |
problems occur with
16.4.1
,16.4.0
(how come neither of these are tagged in github master repo?)All of them go away when you revert to
16.3.0
the last repo tagged version.
solved the optional chaining problem by replacing dependency "prettierx"(0.11 in package) to newest version(currently 0.17). You can try if it could solve other problems.
This is pretty old and I'm running into the same problem. Rolling back to 16.3.0 definitely fixed the issue for me.
@HoraceShmorace this library doesn't seem to be maintained anymore
I've installed
prettier-standard
to my monorepo project. When I runprettier-standard --lint
on the root, I get the following errors:Am I missing something?