Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(eslint-plugin): no-object-literal-type-assertion: fix as const is reported #390

Merged
merged 5 commits into from Apr 7, 2019

Conversation

rhysd
Copy link
Contributor

@rhysd rhysd commented Mar 30, 2019

Fixes #166

as const was added at TypeScript 3.4.1 and no-object-literal-type-assertion detects it. However as const is a special syntax and the rule should not report it as error.

I'm not sure this fix is proper. We might need to add new TSConstType node like TSThisType since as const is different syntax from type assertion. But for now, TypeScript 3.4 was released as stable release and I want this fix as first aid.

@codecov
Copy link

codecov bot commented Apr 7, 2019

Codecov Report

Merging #390 into master will decrease coverage by 0.07%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master     #390      +/-   ##
==========================================
- Coverage   97.15%   97.08%   -0.08%     
==========================================
  Files          69       69              
  Lines        2535     2537       +2     
  Branches      394      395       +1     
==========================================
  Hits         2463     2463              
- Misses         44       45       +1     
- Partials       28       29       +1
Impacted Files Coverage Δ
...ugin/src/rules/no-object-literal-type-assertion.ts 84.61% <100%> (-15.39%) ⬇️

@bradzacher bradzacher merged commit 2521b85 into typescript-eslint:master Apr 7, 2019
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support as const in no-object-literal-type-assertion
3 participants