Sp-dev-docs: Allow disabling of tslint gulp subtask

Created on 11 Nov 2017  路  7Comments  路  Source: SharePoint/sp-dev-docs

Category

  • [x] Question
  • [ ] Typo
  • [ ] Bug
  • [ ] Additional article idea

If you are planning to share a new feature request (enhancement / suggestion), please use SP Dev UserVoice at http://aka.ms/sp-dev-uservoice.

Expected or Desired Behavior

I expect to not have to use typescript in my build chain if I choose not to (for instance to use es2015 with webpack). This was stated as being supported (even if Microsoft will not enhance towards using it)

Observed Behavior

tslint gulp subtask is being run from build.rig by default. I found documentation on how to create a custom gulp task, but not how to turn off/overwrite an existing subtask. How can I do this?

Steps to Reproduce

Change back a generated web part project, No Javascript framework, to not be using typescript. gulp serve will work correctly and it builds to the /dist folder correctly. However, once you delete files like these, you see this error when trying to gulp serve (when tslint is run):

  • tslint.json
  • tslint-tsconfig.json
  • tsconfig.json
  • typings folder

Most helpful comment

getting error
TypeError: Cannot set property 'enabled' of undefined
SPFX v1.8.0

All 7 comments

If you would like to disable the tslint task, you should be able to just add:

build.tslint.enabled = false;

to your gulpfile.js before the build.initialize(gulp) line.

We're working on improving the API surface around the tooling.

Thank you!

getting error
TypeError: Cannot set property 'enabled' of undefined
SPFX v1.8.0

Getting the same error

TypeError: Cannot set property 'enabled' of undefined

SPFX v1.9.1

@hafeez1042 @LuisEnMarroquin
this worked for me in SPFX v 1.9.1

build.tslintCmd.enabled = false;

Issues that have been closed & had no follow-up activity for at least 7 days are automatically locked. Please refer to our wiki for more details, including how to remediate this action if you feel this was done prematurely or in error: Issue List: Our approach to locked issues

Was this page helpful?
0 / 5 - 0 ratings

Related issues

StfBauer picture StfBauer  路  3Comments

ken-harris picture ken-harris  路  3Comments

Ralms picture Ralms  路  3Comments

nanddeepn picture nanddeepn  路  3Comments

StfBauer picture StfBauer  路  3Comments