Comments (3)
Does TS actually allow it? I get errors for both:
from dprint-plugin-typescript.
It does -- if and only if skipLibCheck
is turned on, sorry, I could have sworn I included that in the original issue!
from dprint-plugin-typescript.
In this case, the diagnostic is suppressed because TypeScript does it's best to parse the file and then doesn't surface these errors because of skipLibCheck
being off. I'm going to categorize this one as "wont fix" because it's not valid TypeScript code.
If someone enounters this error, they should manually change their code from opt: ?string
to the equivalent opt: string | null
. That will also make the TypeScript code work in cases where people don't have skipLibCheck
enabled.
In your case of having it as a test file, I recommend adding a // dprint-ignore-file
statement at the top of the file, or exclude it from formatting in the dprint.json config.
from dprint-plugin-typescript.
Related Issues (20)
- Q: Plugin Location HOT 2
- Consider renaming `arrowFunction.useParentheses: "always"` HOT 1
- Interpretation of trailing comments with ASI formatting
- bracePosition: nextLine does not work when passing objects as arguments
- Allow multi-line, multi-argument function calls to maintain formatting
- Duplicate imports do not have a consistent ordering HOT 1
- Break interfaces/types onto multiple lines
- Wrapping of arrow functions in the second argument of functions
- `semiColons` should be spelled `semicolons` because it's a single word. HOT 3
- Allow brackets to be put on the same link as case statement (and potentially allow "break" to be on the same link as the closing bracket)
- Alphabetical ordering of interfaces, classes, properties and methods
- Option to disable the removing of trailing spaces
- dprint moves `else` to the wrong `if` HOT 1
- Incorrect indentation of inner expression in template literal
- Don't trailing generic comma when format tsx file when `trailingComma: never` HOT 3
- cannot format associated files
- Support for Formatting Vue and Svelte Code with `dprint_plugin_typescript::format_text`
- Array of objects is not formatted nicely HOT 1
- Missing space for `export default function doX()` with `spaceBeforeParentheses` HOT 4
- styled-components support
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dprint-plugin-typescript.