Skip to content
This repository has been archived by the owner on Jun 18, 2019. It is now read-only.

TSLint errors question #98

Closed
pr0peller opened this issue May 9, 2016 · 19 comments
Closed

TSLint errors question #98

pr0peller opened this issue May 9, 2016 · 19 comments

Comments

@pr0peller
Copy link
Contributor

Hi,
I'm trying to build the solution and I keep getting errors during linting process.
Declaration of private instance member variable not allowed to appear after declaration of public instance member function.

few files only, but enough to ruin the build. Everything builds and test pass without linting.
Does anybody experience the same issue or it's just me?

Thanks in advance

@pbjorklund
Copy link
Contributor

Hi @pr0peller. If you paste the output here I can check it tomorrow

@pr0peller
Copy link
Contributor Author

pr0peller commented May 9, 2016

Hi,
Here is the output from my console:

npm test
sp-pnp-js@0.0.10 test D:__Source\Repos\PnP-JS-Core
gulp test

(node:14208) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.
[20:08:50] Using gulpfile D:__Source\Repos\PnP-JS-Core\gulpfile.js
[20:08:50] Starting 'lint'...
[20:08:50] Starting 'build-typings'...
[20:08:50] Starting 'clean'...
[20:08:50] Starting 'build-tests'...
[20:08:51] [gulp-tslint] error (member-ordering) collections/collections.ts[30, 5]: Declaration of private instance member variable not allowed to appear after declaration of public instance member function
[20:08:51] [gulp-tslint] error (member-ordering) configuration/configuration.ts[41, 5]: Declaration of private instance member variable not allowed to appear after declaration of public instance member function
[20:08:51] Finished 'clean' after 603 ms
[20:08:51] [gulp-tslint] error (member-ordering) net/HttpClient.ts[13, 5]: Declaration of private instance member variable not allowed to appear after declaration of public instance member function
[20:08:51] [gulp-tslint] error (member-ordering) utils/storage.ts[197, 5]: Declaration of public instance member variable not allowed to appear after declaration of public instance member function
[20:08:52] [gulp-tslint] error (member-ordering) sharepoint/rest/Queryable.ts[51, 5]: Declaration of public instance member variable not allowed to appear after declaration of public instance member function
[20:08:52] [gulp-tslint] error (eofline) sharepoint/rest/contenttypes.ts[222, 2]: file should end with a newline
[20:08:55] [gulp-tslint] error (member-ordering) sharepoint/rest/search.ts[246, 5]: Declaration of private instance member variable not allowed to appear after declaration of public instance member function
[20:08:55] [gulp-tslint] error (member-ordering) sharepoint/rest/search.ts[309, 5]: Declaration of public instance member variable not allowed to appear after declaration of public instance member function
[20:08:55] [gulp-tslint] error (member-ordering) sharepoint/rest/userprofiles.ts[15, 5]: Declaration of private instance member variable not allowed to appear after declaration of public instance member function
[20:08:56] 'lint' errored after 5.81 s
[20:08:56] Error in plugin 'gulp-tslint'
Message:
Failed to lint: collections/collections.ts[30, 5]: Declaration of private instance member variable not allowed to appear after declaration of public instance member function, configuration/configuration.ts[41, 5]: Declaration of private instance member variable not allowed to appear after declaration of public instance member function, net/HttpClient.ts[13, 5]: Declaration of private instance member variable not allowed to appear after declaration of public instance member function, utils/storage.ts[197, 5]: Declaration of public instance member variable not allowed to appear after declaration of public instance member function, sharepoint/rest/Queryable.ts[51, 5]: Declaration of public instance member variable not allowed to appear after declaration of public instance member function, sharepoint/rest/contenttypes.ts[222, 2]: file should end with a newline, sharepoint/rest/search.ts[246, 5]: Declaration of private instance member variable not allowed to appear after declaration of public instance member function, sharepoint/rest/search.ts[309, 5]: Declaration of public instance member variable not allowed to appear after declaration of public instance member function, sharepoint/rest/userprofiles.ts[15, 5]: Declaration of private instance member variable not allowed to appear after declaration of public instance member function.
[20:08:57] Finished 'build-tests' after 7.05 s
[20:08:57] Finished 'build-typings' after 7.15 s
npm ERR! Test failed. See above for more details.

D:__Source\Repos\PnP-JS-Core (dev) (sp-pnp-js@0.0.10)`

Thank you @pbjorklund

@mike-morr
Copy link
Contributor

@pbjorklund @pr0peller I got these same errors out of nowhere the other day. I had to move all of the failing items above the constructor to make the errors go away. I assumed the tslint rules changed and that a PR was probably pending already to fix it.

@pr0peller
Copy link
Contributor Author

Same here. Lint was fine yesterday. Thanks for the info @mike-morrison

@pbjorklund
Copy link
Contributor

Is this against the master or dev branch?

@pr0peller
Copy link
Contributor Author

@pbjorklund It is against dev branch

@pr0peller
Copy link
Contributor Author

@pbjorklund Same issue against master branch - just checked!

@patrick-rodgers
Copy link
Contributor

I just pulled dev and ran gulp lint and could not reproduce this. tslint rules haven't changed so far as I am aware.

@biste5
Copy link
Contributor

biste5 commented May 9, 2016

I could reproduce it couple of days back from dev branch, while working on my PR.

I didn't commit my tslint.json then, which I used to check successful build. Wanted to raise the issue myself too

@russgove
Copy link
Contributor

I had the isues on Saturday and changed my talking to fix it

@mike-morr
Copy link
Contributor

I noticed it for the first time on a Mac, but I am pretty sure I got it on Windows too.

@patrick-rodgers
Copy link
Contributor

I just noticed you are doing "npm test" instead of "gulp test". I re-pulled latest from dev and tried that and it worked as expected. So far as I know nothing had changed on my machine, and I am pulling from the dev branch in git with no local changes. tslint.json hasn't been updated in some time. Unsure, if someone who can reproduce this can investigate that would be appreciated but everything appears fine. I have version 3.3.12 of tslint, but haven't done anything special to it (at least that I am aware of).

@biste5
Copy link
Contributor

biste5 commented May 10, 2016

It has to do with an issue in TSLint seems, not with what we were doing.
So it's depending on which version of TSLint is being used and should be fixed soon.

I'm using TSLint 3.8.0 and have the issue.

@pbjorklund
Copy link
Contributor

It has to do with the fact that we use caret ranges for tslint and gulp-tslint. @biste5 is most likely correct that it will be solved upstream soon enough.

We could lock down versions to specific versions in package.json.

For now you can resolve with npm install tslint@3.6.0 gulp-tslint@4.3.2

@pr0peller
Copy link
Contributor Author

I'll check my version of TSLint when I get home, but I think I'm running 3.8.0 also. Not 100% sure though ...

@pr0peller
Copy link
Contributor Author

pr0peller commented May 10, 2016

I'm using TSLint 3.9.0 downgraded to 3.6.0 as @pbjorklund advice and now it is working.

@patrick-rodgers
Copy link
Contributor

patrick-rodgers commented May 10, 2016

So before I close this want to confirm:

  1. It is now working
  2. this was due to an issue with tslint and not a change in our library somewhere?

@pr0peller
Copy link
Contributor Author

Correct, With TSLint 3.6.0 works. The Issue is in the newer version of TSLint tool.

@patrick-rodgers
Copy link
Contributor

Thanks, I'll close this. Appreciate everyone who had a look.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants