Consistency/linting roadmap
See original GitHub issueFollowing the long discussion in #1475, I think it would be nice to write a little roadmap to improve code consistency.
Before moving to eslint
- Remove unnecessary escape in regex:
{
,}
need no escape and neither do[
,]
when used inside character class. Ruleno-useless-escape
. - Strings should single quotes. Backticks should be reserved for strings using substitution. Rule:
quotes
. - Statements should not end with a
;
. - Remove all
// @ts-ignore
and fix the errors. These are trickier so I will wait until we merge #1543. See PR #1545.
Breaking rules compared to tslint
.
- Remove extra space before
:
when giving explicit type. Rule@typescript-eslint/type-annotation-spacing
.
Non default eslint
rules we want to enforce
- Prefer
type
overinterface
. See here. - Ignore everything in
src/lib
. - Properties can be declared in the constructor. set
"@typescript-eslint/no-parameter-properties": "off"
.
Extra changes
- Convert
.plist
syntax files to.tmLanguage.json
. I find.json
files much easier to edit and maintain and they allow for more elaborate constructions not available in the.plist
(say.xml
) format. The vscode-tmlanguage extension can be used as a conversion tool.
Such changes may induce a lot of modifications and tend to blur file history. So, I want to make sure there is no objection before making any change. I will try to update this post with any further discussion.
The Done ticks refer to the developments in branch format.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:4
- Comments:9 (6 by maintainers)
Top Results From Across the Web
Linting the Stoplight Docs with Vale
It helps teams maintain a consistent style, and voice, across their documentation; Improve collaboration by having clear rules to follow. It can ...
Read more >Announcing AsyncAPI & Spectral – Together!
The collaboration between Stoplight's open-source linting tool, Spectral, and AsyncAPI will be a game-changer for creating more consistency ...
Read more >Roadmap: TSLint -> ESLint · Issue #4534 · palantir/tslint - GitHub
As you may have read in this blog post, we plan to deprecate TSLint in 2019 and support the migration to ESLint as...
Read more >Overview | Buf®
Overview. Using a linter on your Protobuf sources enables you to enforce consistency and keep your API definitions in line with your chosen...
Read more >Linting in a monorepo - Turborepo
We recommend specifying a single lint task inside your turbo.json . ... across a monorepo helps keep the development experience consistent.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
To eliminate the warning,
warning File ignored because of a matching ignore pattern
, we have to call eslint with.
, not with a glob pattern,src/**/*.ts
. See eslint/eslint/issues/5623.By adding the following entries to
.eslintignore
,we have to call eslint with the
--ext
option,The extension will be able to be specified in a config file in the future release. See https://github.com/eslint/rfcs/tree/master/designs/2019-additional-lint-targets
We had better exclude
src/lib/**/*.ts
using .eslintignore.I have posted separated comments to enable them to be hidden if resolved.