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

New: Add rule schemas (refs #2179) #2580

Merged
merged 1 commit into from May 21, 2015
Merged

New: Add rule schemas (refs #2179) #2580

merged 1 commit into from May 21, 2015

Conversation

btmills
Copy link
Member

@btmills btmills commented May 20, 2015

There are a lot of files in this PR, most of which are just adding schemas, so I've summarized the interesting changes below. Because this only adds schemas but does not enable any validation, there aren't any tests here to make sure the schemas are actually correct. I did that back in #2179, but I do anticipate that some will have fallen out of sync and will need to be updated when validation is enabled by a subsequent PR.

Docs

  • docs/developer-guide/working-with-rules.md: Document the new schema property exported by rules.

Rule defaults

  • lib/rules/max-len.js: Default to 4-space tabs and 80-character lines.
  • tests/lib/rules/max-len.js: Add tests for default option values.
  • lib/rules/quotes.js: Default to double quotes.
  • tests/lib/rules/quotes.js: Add tests for default option values.

Invalid test cases

  • tests/lib/rules/comma-dangle.js: Incorrect configuration values are now caught.
  • tests/lib/rules/indent.js: Incorrect configuration values are now caught.
  • tests/lib/rules/newline-after-var.js: Incorrect configuration values are now caught.
  • tests/lib/rules/brace-style.js: Test case args were using string error levels. Switch to options instead.
  • tests/lib/rules/comma-style.js: Test case args were using string error levels. Switch to options instead.
  • tests/lib/rules/no-cond-assign: Test case args were using string error levels. Switch to options instead.
  • tests/lib/rules/space-in-parens.js: Test case args were using string error levels. Switch to options instead. Additionally, incorrect configuration values are now caught.
  • tests/lib/rules/no-undef.js: Remove vestigial options left over from since-removed React support.
  • tests/lib/rules/no-unused-vars.js: Correct spelling of an invalid test case option.
  • tests/lib/rules/one-var.js: Correct type of invalid test case options.
  • tests/lib/rules/quotes.js: Correct position of invalid test case options.

"exceptions": {
"type": "object",
"patternProperties": {
"^([A-Z][a-z]*)+$": {
Copy link
Member

Choose a reason for hiding this comment

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

Should this be "^[A-Za-z]+$"

Copy link
Member Author

Choose a reason for hiding this comment

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

Don't think so. I'm looking to match ESTree node types, which, so far, are PascalCased. I think that's what this does.

Copy link
Member Author

Choose a reason for hiding this comment

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

...and now I see yours is a simpler version of the above. I'll change it, good call!

Copy link
Member

Choose a reason for hiding this comment

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

Wait, mine is not a check for pascal case. It's just a check for a string of letters. Yours is a check for PascalCased string. Not 100% sure it's necessary, but those two RegEx do different things.

Copy link
Member Author

Choose a reason for hiding this comment

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

I suppose the extra restriction can't hurt. I just pushed a commit to change it back.

@ilyavolodin
Copy link
Member

I think this is ready to merge. It shouldn't affect anything, since it's not going to be enabled yet.

ilyavolodin added a commit that referenced this pull request May 21, 2015
@ilyavolodin ilyavolodin merged commit dd6f549 into master May 21, 2015
@ilyavolodin ilyavolodin deleted the schema-part2 branch May 21, 2015 14:55
@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Feb 7, 2018
@eslint-deprecated eslint-deprecated bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Feb 7, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants