I am utilizing TypeScript alongside TSLint and Prettier within Visual Studio Code for developing a React Native App.
Despite my efforts to set up my editor to automatically wrap the code per line at 100 characters, it consistently reverts back to 80 characters after saving.
Below are the modifications I made:
"prettier.tslintIntegration": true,
"prettier.printWidth": 100,
"editor.renderIndentGuides": true,
"editor.rulers": [100],
"editor.wordWrapColumn": 100,
"editor.formatOnSave": true
Additionally, here is my tslint.json
configuration:
{
"extends": ["tslint:recommended", "tslint-react", "tslint-config-prettier"],
"rules": {
// "jsx-no-lambda": false,
"member-access": false,
"interface-name": false,
"max-line-length": [true, 100]
}
}
Despite configuring everything as mentioned above, my code keeps wrapping around 80 characters. How can this be resolved?
If a line exceeds 100 characters, a linting error appears, indicating that the tslint.json
setting is functioning properly.
As an additional note, below are the complete VSCode settings in case any elements were overlooked:
{
"telemetry.enableTelemetry": false,
"workbench.colorTheme": "One Dark Pro",
"workbench.iconTheme": "vscode-icons",
"window.zoomLevel": 0,
"prettier.eslintIntegration": true,
"prettier.tslintIntegration": true,
"prettier.printWidth": 100,
"editor.renderIndentGuides": true,
"editor.rulers": [100],
"[javascript]": {
"editor.tabSize": 2
},
"[typescript]": {
"editor.tabSize": 2
},
"[typescriptreact]": {
"editor.tabSize": 2
},
"[json]": {
"editor.tabSize": 2
},
"workbench.colorCustomizations": {
// "statusBar.background": "#272b33",
// "panel.background": "#30353f",
// "sideBar.background": "#2a2b33",
"editor.background": "#2c313a"
},
"todohighlight.keywords": [
{
"text": "DEBUG:",
"color": "#fff",
"backgroundColor": "limegreen",
"overviewRulerColor": "grey"
},
{
"text": "NOTE:",
"color": "#fff",
"backgroundColor": "mediumslateblue",
"overviewRulerColor": "grey"
},
{
"text": "REVIEW:",
"color": "#fff",
"backgroundColor": "dodgerblue",
"overviewRulerColor": "grey"
},
{
"text": "XXX:",
"color": "#fff",
"backgroundColor": "orangered",
"overviewRulerColor": "grey"
}
],
"editor.wordWrapColumn": 100,
"editor.formatOnSave": true
}