The Wayback Machine - https://web.archive.org/web/20210630123147/https://github.com/sveltejs/svelte/pull/4942
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lint without any immediate changes #4942

Merged
merged 2 commits into from Jun 6, 2020

Conversation

@antony
Copy link
Member

@antony antony commented May 31, 2020

Second attempt at a lint config, this time with zero code changes (aside from removing a dead rule).

This should give us a good baseline to build a tighter, democratic lint config from. Currently there are 723 warnings which can be fixed by auto-linting (or manual fixing of the issues) - in a separate PR.

This PR depends on the release of https://github.com/sveltejs/eslint-config to work.

Before submitting the PR, please make sure you do the following

  • It's really useful if your PR relates to an outstanding issue, so please reference it in your PR, or create an explanatory one for discussion. In many cases features are absent for a reason.
  • This message body should clearly illustrate what problems it solves. If there are related issues, remember to reference them.
  • Ideally, include a test that fails without this PR but passes with it. PRs will only be merged once they pass CI. (Remember to npm run lint!)

Tests

  • Run the tests tests with npm test or yarn test)
.eslintignore Show resolved Hide resolved
@tanhauhau
Copy link
Member

@tanhauhau tanhauhau commented May 31, 2020

The CI failed? @antony

@antony
Copy link
Member Author

@antony antony commented May 31, 2020

The CI failed? @antony

The CI can't possibly pass until https://github.com/sveltejs/eslint-config exists (i.e. is published to NPM)

@benmccann
Copy link
Member

@benmccann benmccann commented Jun 3, 2020

@antony what do you think about going ahead and publishing @sveltejs/eslint-config? It seems a pretty safe starting point since it keeps things exactly as is. Then I can go ahead and update sveltejs/sapper#1198 to use it too

@antony
Copy link
Member Author

@antony antony commented Jun 4, 2020

I'm happy to, but I don't have credentials. @Conduitry are you OK with this? Build config is in place, just needs NPM_TOKEN secret added to repo secrets, then it will publish on tag.

@Conduitry
Copy link
Member

@Conduitry Conduitry commented Jun 4, 2020

npm auth is something I'm a bit vague on. If I have 2FA enabled on my npm account, is there a way to generate a token that doesn't need a 2FA challenge to publish? And is there a way to generate a token that only permits publishing that one package?

@antony
Copy link
Member Author

@antony antony commented Jun 4, 2020

@benmccann
Copy link
Member

@benmccann benmccann commented Jun 4, 2020

They've got some instructions that mention 2FA: https://docs.npmjs.com/creating-and-viewing-authentication-tokens

@Conduitry
Copy link
Member

@Conduitry Conduitry commented Jun 4, 2020

Is there at least a way to create a token scoped to a particular org? Is my best bet to create a dummy user whose one ability is to be able to publish this package, and to create a token for it?

@Conduitry
Copy link
Member

@Conduitry Conduitry commented Jun 4, 2020

Alternatively, do we want to just not publish to npm at all, and install from Git tags wherever we use this? We don't expect other people to be using this - there's not really a convenience reason for it to even be on npm.

@benmccann
Copy link
Member

@benmccann benmccann commented Jun 5, 2020

I'm not aware of anyway to scope tokens beyond their read/write permissions. I think the other project I work on went the dummy user route.

I've been installing Sapper via git url in my project and it's annoying because it has to run npm install, which takes a long time due to Cypress. I'm guessing npm install would be really fast on the eslint package though, so that's probably a fine way to go if it's just a couple projects using the package.

@Conduitry
Copy link
Member

@Conduitry Conduitry commented Jun 5, 2020

Yeah I don't see install time being a problem. The reason installing Sapper from Git takes so long is that its package.json has a prepare script, which means that npm also downloads all of its devdeps and runs npm run prepare in it (which runs npm run build) to get the built assets that aren't checked into the repo. But I can't imagine there'd have to be a build process with the ESLint config. It's probably pretty much just one CommonJS module exporting a configuration object.

@benmccann
Copy link
Member

@benmccann benmccann commented Jun 5, 2020

Yeah, I just tested locally and it's pretty painless. One thing I still wonder though is if it will be harder to keep it up-to-date. Will npm-check-updates work in that scenario?

@antony
Copy link
Member Author

@antony antony commented Jun 5, 2020

@Conduitry it's certainly an option yes - the only issue is that every time we added a rule we'd have to go and validate that the rule passed on every project, and update the ones which used it (which should eventually be all of them), otherwise the next person who makes a change is going to also have to lint the project according to the new rules. The rules will be in flux to begin with, so this will become a very arduous process.

I can imagine that opening a PR on ten projects for every new rule is going to hinder us considerably, to the point where we'd probably avoid doing it.

Having a versioned package which can be updated (turning rules to errors / adding new errors would be breaking) means that we can do this process as-and-when.

So I guess I have to vote no on this one.

@Conduitry
Copy link
Member

@Conduitry Conduitry commented Jun 5, 2020

We can still use git tags for versions, and npm has a feature that lets semver ranges work against git tags. https://docs.npmjs.com/cli/install (#semver:...) Because of lockfiles, we'd need to open PRs against every project anyway even if we were publishing to npm.

@antony
Copy link
Member Author

@antony antony commented Jun 6, 2020

Ok. I'm willing to give this a go. I will update the PR shortly.

@antony
Copy link
Member Author

@antony antony commented Jun 6, 2020

Ok - updated and installed as v0.0.1 from github, pending build passing, this should be ready to go with no further changes.

@Conduitry Conduitry merged commit 0f5fe65 into sveltejs:master Jun 6, 2020
16 checks passed
16 checks passed
@github-actions
Tests (8, ubuntu-latest)
Details
@github-actions
Tests (8, windows-latest)
Details
@github-actions
Tests (8, macOS-latest)
Details
@github-actions
Tests (10, ubuntu-latest)
Details
@github-actions
Tests (10, windows-latest)
Details
@github-actions
Tests (10, macOS-latest)
Details
@github-actions
Tests (12, ubuntu-latest)
Details
@github-actions
Tests (12, windows-latest)
Details
@github-actions
Tests (12, macOS-latest)
Details
@github-actions
Tests (14, ubuntu-latest)
Details
@github-actions
Tests (14, windows-latest)
Details
@github-actions
Tests (14, macOS-latest)
Details
@github-actions
Lint Lint
Details
@github-actions
Unit (ubuntu-latest)
Details
@github-actions
Unit (windows-latest)
Details
@github-actions
Unit (macOS-latest)
Details
@antony antony deleted the antony:feature/eslint-config-baseline branch Jun 7, 2020
taylorzane added a commit to taylorzane/svelte that referenced this pull request Dec 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants