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

Deprecate rules #2197

Merged
merged 6 commits into from Dec 29, 2016
Merged

Deprecate rules #2197

merged 6 commits into from Dec 29, 2016

Conversation

m-allanson
Copy link
Member

Which issue, if any, is this issue related to?

#2123

Is there anything in the PR that needs further explanation?

Merges into a new deprecations branch.

Copy link
Contributor

@davidtheclark davidtheclark left a comment

Choose a reason for hiding this comment

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

@m-allanson Fantastic! Thanks!

Code looks good to me. I don't have time for another little while to double-check the output in detail — can someone else on @stylelint/core review and merge?


```css
a { color: red; }
/** ↑ ↑
Copy link
Contributor

Choose a reason for hiding this comment

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

Extra arrow.


```css
a { color: red; }
```
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of three separate code blocks, I suggest one block following "But not these patterns:" No need for extra verbosity, I think.

a { color: red; }
```

To allow single line blocks, use the `"always-multi-line"` option for both rules.
Copy link
Contributor

Choose a reason for hiding this comment

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

How about: To allow single-line blocks but enforce newlines with multi-line blocks, ...

@@ -17,6 +17,8 @@ a { /* end-of-line comment */
}
```

Refer to [the FAQ](../../../docs/user-guide/faq.md#how-do-i-disallow-single-line-blocks) for more information on using this rule with [`block-opening-brace-newline-before`](../block-opening-brace-newline-before/README.md)
Copy link
Contributor

Choose a reason for hiding this comment

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

How about appending "to disallow single-line rules."

@@ -9,6 +9,8 @@ Require a newline or disallow whitespace before the opening brace of blocks.
* The newline before this brace */
```

Refer to [the FAQ](../../../docs/user-guide/faq.md#how-do-i-disallow-single-line-blocks) for more information on using this rule with [`block-opening-brace-newline-after`](../block-opening-brace-newline-after/README.md)
Copy link
Contributor

Choose a reason for hiding this comment

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

How about appending "to disallow single-line rules."

const results = data.results[0]
expect(results.deprecations.length).toEqual(1)
expect(results.deprecations).toEqual(deprecationResult)
expect(results.invalidOptionWarnings.length).toBe(0)
})
Copy link
Contributor

Choose a reason for hiding this comment

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

Any of the tests in this particular file that tested declaration-block-properties-order should just be removed, I think. We don't want validate-options tests to be tangled up with deprecations.

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'll create a separate file for the deprecation test.

@@ -1,7 +1,16 @@
exports[`test 002 1`] = `
Array [
Object {
"deprecations": Array [],
Copy link
Contributor

Choose a reason for hiding this comment

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

Great idea to add these system tests!

Copy link
Member Author

Choose a reason for hiding this comment

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

The system tests are great for changes like this 👍 .

@jeddy3
Copy link
Member

jeddy3 commented Dec 17, 2016

— can someone else on @stylelint/core review and merge?

I can review and merge tomorrow.

@m-allanson
Copy link
Member Author

@davidtheclark Good catches, thanks! I've updated the PR to account for your comments.

Copy link
Member

@jeddy3 jeddy3 left a comment

Choose a reason for hiding this comment

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

Deprecation code instead looks good to me.

I've made a request that we make use of the release planning doc.

@@ -1,5 +1,7 @@
# declaration-block-no-ignored-properties

***Deprecated: this rule is outside the scope of stylelint's functionality. See [this comment](https://github.com/stylelint/stylelint/issues/2047#issuecomment-261382105) for details.***
Copy link
Member

@jeddy3 jeddy3 Dec 18, 2016

Choose a reason for hiding this comment

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

Let's point to http://stylelint.io/user-guide/release-planning/ here instead (and, in a separate PR, add something there about each of these deprecated rules)

This provides us with a single destination for 8.0.0 changes and planning, where we can create a consistent narrative that we can link to when needed.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good idea, done.

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh hang on, I've muddled the branches a bit. Will fix it soon.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ok, fixed.

@m-allanson
Copy link
Member Author

@jeddy3 this is ready for another look.

@jeddy3
Copy link
Member

jeddy3 commented Dec 29, 2016

@m-allanson Awesome thanks! I trust you're having a pleasant xmas? I'm going to try to catch-up on a few stylelint issues and PRs today... I see you've been busy pushing code :)

@jeddy3 jeddy3 merged commit 40a2e04 into deprecations Dec 29, 2016
@jeddy3 jeddy3 deleted the deprecate-rules branch December 29, 2016 11:57
@m-allanson
Copy link
Member Author

I trust you're having a pleasant xmas?

@jeddy3 Very much so, it's been surprisingly calm around here :)

@ntwb
Copy link
Member

ntwb commented Dec 30, 2016

I trust you're having a pleasant xmas?
@jeddy3 Very much so, it's been surprisingly calm around here :)

Apart from the awesome PR's you've been submitting @m-allanson 🎉

hudochenkov pushed a commit that referenced this pull request Jan 24, 2017
* Deprecate rules

* Add system test for deprecated rules

* Update docs to account for deprecated rules

* Documentation tweaks

* Use a separate file to test the deprecation for declaration-block-properties-order

* Point to release planning docs in deprecated rule READMEs
jeddy3 pushed a commit that referenced this pull request Jan 29, 2017
jeddy3 added a commit that referenced this pull request Jan 29, 2017
sergesemashko pushed a commit to sergesemashko/stylelint that referenced this pull request Mar 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants