We are using typescript v2.3.2 and TSLint v4.5.1 with VS Code to create a SPA. Codebase is growing and we need to modularize it someway.
I tried to do the modularization using typescript modules but found the following lint error when transpiling the app.
[tslint] 'namespace' and 'module' are disallowed (no-namespace)
I'm using this configuration for the linter:
{ "extends": "tslint:recommended", "rules": { "no-var-requires": false, "no-console": ["error", false], "max-line-length": [false] } }
The recommended rules file at line 89 shows this rule:
"no-namespace": true,
I wonder if there is something wrong and what would be the best way to modularize a SPA, following good practices that are not obsolete soon.
Examples of code will be welcomed. Thank you very much.
TSLint is an extensible static analysis tool that checks Javascript and TypeScript code for readability, maintainability, and functionality errors. It can be integrated into build systems and editors. It has a set of core rules built into and configuration that allows it to be extended with custom rules.
TSLint is an extensible static analysis tool that checks TypeScript code for readability, maintainability, and functionality errors. It is widely supported across modern editors & build systems and can be customized with your own lint rules, configurations, and formatters.
When using the CLI or many third-party tools, a file named tslint. json or tslint. yaml is used to configure which rules get run and each of their options.
[tslint] 'namespace' and 'module' are disallowed (no-namespace)
Because the are not standard JavaScript syntax.
outFile
: https://basarat.gitbook.io/typescript/docs/tips/outFile.html If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With