Skip to content

update codelyzer and related - #279

Merged
Foxandxss merged 4 commits into
preboot:masterfrom
GaryB432:update-codelyzer
Jan 24, 2017
Merged

Foxandxss merged 4 commits into
preboot:masterfrom
GaryB432:update-codelyzer

Conversation

@GaryB432

Copy link
Copy Markdown
Contributor

Goals:

  • update codelyzer/tslint
  • have no impact on existing src contents

All rules recommended by codelyzer, except templates-use-public, are enabled.

The no-unused-variable rule is no longer supported by ts-lint. The check is handled by typescript@2.0 itself with the noUnusedLocals and noUnusedParameters compiler options. Staying away from modifying your src folder, I did not set these flags in tsconfig.json because "Property 'api' is declared but never used." in app component. This passed the old no-unused-variable rule as is, I guess because of it being a "parameter property" or being used in the template. (?)

no-unreachable is similiarly covered by the --allowUnreachableCode tsc compiler option.

label-undefined and no-duplicate-key are also no longer part of ts-lint and supported by tsc.

Other rule changes are due to combining, for example, the older component/directive naming rules.

I have gone further in my fork and would be happy to update this branch with the following. Let me know.

  • enable templates-use-public per this thinking which has convinced me
  • enable noUnusedLocals and noUnusedParameters in tsconfig.json
  • make the following changes to app.component.ts in support of these new settings
 constructor(public api: ApiService) {
  // Do something with api
  console.log(api.title);
}

I am also enabling some security-related rules from Microsoft which are interesting but I predict you'll not want those as you strive to maintain the starter's simplicity. Let me know othewise.

This is the best starter kit. Thanks for your hard work!

@Foxandxss

Copy link
Copy Markdown
Member

I am good with bringing the templates use public and the tsconfig part.

For the service, perhaps it would be better to create a public variable and assign what we need from the API other than putting the entire api public.

Gary Bortosky added 2 commits January 23, 2017 21:29
Comment thread package.json Outdated
"tslint-loader": "^3.3.0",
"typedoc": "^0.5.1",
"typescript": "2.0.10",
"typescript": "2.1.5",

@Foxandxss Foxandxss Jan 23, 2017 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

revert this one please. TS2.1.x doesn't work with AOT (yes, I don't have it here yet) but I know people adding AOT on this and they will be confused.

@Foxandxss
Foxandxss merged commit 84d25c8 into preboot:master Jan 24, 2017
@GaryB432
GaryB432 deleted the update-codelyzer branch January 24, 2017 17:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants