JSX but not React in scope #351

Closed
HenrikJoreteg opened this Issue Dec 2, 2015 · 38 comments

Projects

None yet

10 participants

@HenrikJoreteg

I'm using JSX syntax to generate virtual-dom/h code using babel plugins (this specifically).

Only problem is, now standard complains because React is not in scope.

Not quite sure how this should be addressed, however. Because that check is useful when using React.

@HenrikJoreteg

Perhaps it'd just be best to remove that rule? Not having React in scope will blow up pretty quickly. That's doesn't seems like something that would cause subtle bugs, it just blows up :)

@jprichardson
Collaborator

Why not just disable it for your use case?

Put this at the top of your file:

/* eslint-disable react-in-jsx-scope */
@feross
Owner
feross commented Dec 2, 2015

@jprichardson Wouldn't disabling the rule be friendlier for people using React competitors like Riot and Deku? I don't really want to be opinionated and push people to React without a good reason.

@jprichardson
Collaborator

@feross yep.

I don't really want to be opinionated and push people to React without a good reason.

Alright, fair enough. While it's nice to have the live feedback in my IDE (linter-js-standard) when I forget to add React with JSX, I definitely understand this perspective and don't have a strong feeling either way.

@dcousens
Collaborator
dcousens commented Dec 3, 2015

This error is almost impossible to miss, as the code simply will fail at require time in almost all cases.
I'm OK with it being disabled.

@feross
Owner
feross commented Dec 3, 2015

@HenrikJoreteg want to send a PR?

@HenrikJoreteg

Sure, will do
On Wed, Dec 2, 2015 at 19:00 Feross Aboukhadijeh notifications@github.com
wrote:

@HenrikJoreteg https://github.com/HenrikJoreteg want to send a PR?


Reply to this email directly or view it on GitHub
#351 (comment).

@HenrikJoreteg HenrikJoreteg added a commit to HenrikJoreteg/eslint-config-standard-react that referenced this issue Dec 3, 2015
@HenrikJoreteg HenrikJoreteg change react-in-jsx-scope as per feross/standard#351 263162f
@HenrikJoreteg HenrikJoreteg referenced this issue in feross/eslint-config-standard-react Dec 3, 2015
Merged

change react-in-jsx-scope as per feross/standard#351 #11

@HenrikJoreteg

Didn't know if you need anything else in terms or tests or whatnot. Just tweaked the config in the other module? Just lemme know if i missed something.

@HenrikJoreteg

it does raise an interesting question, however. Now what happens to the h that's an unused variable?

@feross
Owner
feross commented Dec 3, 2015

@HenrikJoreteg So, now you get an unused variable warning?

@HenrikJoreteg

right

@dcousens
Collaborator
dcousens commented Dec 3, 2015

I merged that change, but, we can roll it back if necesssary.

If h is undefined, then, you should global it out IMHO.

@HenrikJoreteg

@dcousens doing /*global h*/ doesn't solve it because h is an unused variable. Have to do: /*eslint no-unused-vars: [2, {"varsIgnorePattern": "h"}]*/

@Flet
Collaborator
Flet commented Dec 10, 2015

We currently have a way to define globals via package.json, perhaps we need a way to define unused vars too?

@rstacruz
Collaborator

not sure if this is relevant, but setting h as a global in package.json will not throw a no-unused-vars error if it's not used.

@Flet
Collaborator
Flet commented Dec 10, 2015

Roger that, @rstacruz! That should be a way to get around the error for sure!

@HenrikJoreteg

I agree that'd be a nice way to do it. I could see this kind of thing
happening more and more now that people are doing more things with babel
plugins.

On Wed, Dec 9, 2015 at 9:38 PM Dan Flettre notifications@github.com wrote:

We currently have a way to define globals via package.json, perhaps we
need a way to define unused vars too?


Reply to this email directly or view it on GitHub
#351 (comment).

@rstacruz
Collaborator

Running into this myself. When using something else for JSX other than React, a whole slew of errors actually happen. Here's a simple example using deku

/** @jsx element */
import 'element' from 'magic-virtual-element'
import { render, tree } from 'deku'

render(tree(<div class='box'></div>), document.body)
  • 'React' must be in scope when using JSX (react/react-in-jsx-scope)
  • Unknown property 'class' found, use 'className' instead (react/no-unknown-property)
  • "element" is defined but never used (no-unused-vars)

I really wanna use standard on this new project but all of these things make it a pain.

@garth
garth commented Jan 10, 2016

Same problem with snabbdom-jsx. We are trying to port cerebral to standard, but hit this blocking issue.

The only way to use standard is to wrap all jsx related imports with

/*eslint-disable no-unused-vars*/

and every jsx file with

/*eslint-disable react/react-in-jsx-scope*/

disabling react-in-jsx-scope is just an inconvenience, but disabling no-unsed-vars is bad.

In order to use jsx with something other than react it is necessary to declare the plugin in your .babelrc

  "plugins": [
    [ "transform-react-jsx", { "pragma": "Component.DOM" } ]
  ]

Maybe standard could check this, then instead of checking for React it could now check for Component and auto fix both of the above rules?

@dcousens
Collaborator

@feross perhaps we ditch react in the next major? Is it possible for us to do things like eslint-env react?

@rstacruz
Collaborator

As a lateral thought, it'd be nice for standard-engine to pick up your local .eslintrc.

You can set your eslintrc to this:

{
  "extends": ["standard", "standard-react"]
}

...and customize it as you see fit.

@dcousens
Collaborator

@rstacruz that would be neat.

@rstacruz rstacruz referenced this issue in Flet/standard-engine Jan 10, 2016
Closed

Using eslintrc from the project #47

@HenrikJoreteg

I ended up adding React as a global in package.json which isn't a terrible solution, though a bit hacky.

I almost wonder if standard should just ignore react-related settings beyond tolerating JSX.

@dcousens
Collaborator

@HenrikJoreteg it really does feel like it should just be an extension, so I'm not impartial to that either.

@feross
Owner
feross commented Feb 4, 2016

Yeah, I'd like to eliminate built-in React rules (i.e. eslint-config-standard-react) from standard. We can create a standard-react package for those who want the old behavior, with built-in react support.

@feross
Owner
feross commented Feb 4, 2016

I'm trying to wrap my head around the unused variable thing. Can someone help me understand?

@rstacruz In your example:

/** @jsx element */
import 'element' from 'magic-virtual-element'
import { render, tree } from 'deku'

render(tree(<div class='box'></div>), document.body)

It does appear that 'element' is an unused variable. I'm guessing that the @jsx pragma thing is actually making use of it, though?

What can standard do to accommodate this better?

@feross feross referenced this issue Feb 4, 2016
Closed

Release proposal: standard v6 #399

25 of 25 tasks complete
@feross feross closed this in f0d1983 Feb 4, 2016
@feross
Owner
feross commented Feb 4, 2016

React-specific rules are removed in master now, in preparation of standard v6. 👍

@HenrikJoreteg @jprichardson @dcousens @Flet @rstacruz @garth Let me know if you think of a way to fix the JSX unused variable issue, or at least make it easier to deal with.

@feross feross added a commit to feross/eslint-config-standard that referenced this issue Feb 5, 2016
@feross enable jsx support for standard 6
standard v6 will not use the eslint sharable config
“eslint-config-standard-react” anymore.

So, let’s add support for jsx syntax in the parser in
eslint-config-standard.

Discussion: feross/standard#351
3f99e4e
@feross
Owner
feross commented Feb 6, 2016

Alright, I've gotten it so that @rstacruz's example doesn't have any issues in standard v6 and will just pass. The /* @jsx element */ pragma is used when it exists, and the other react-specific rules are gone.

But I'm still going to keep the basic sanity-check JSX rules. Here's the list:

    "react/jsx-boolean-value": 2,
    "react/jsx-closing-bracket-location": 2,
    "react/jsx-indent": [2, 2],
    "react/jsx-indent-props": [2, 2],
    "react/jsx-no-duplicate-props": 2,
    "react/jsx-no-undef": 2, // 
    "react/jsx-uses-react": 2, // doesn't actually require react -- uses @jsx pragma
    "react/jsx-uses-vars": 2, // marks variables in jsx as used
    "react/self-closing-comp": 2

And the no-unknown-property is removed.

@feross feross added a commit that referenced this issue Feb 6, 2016
@feross add eslint-config-standard-jsx
Basic JSX sanity check rules. See:
#351 (comment)
48fb60c
@kvz kvz added a commit to freyproject/frey that referenced this issue Feb 7, 2016
@kvz kvz Upgrade node dependencies
- Fix README typo.
- Merge pull request #27 from mleeds95/master
  Fix README typo.
- Use is-buffer to detect buffers without the Buffer module (browserify)
- Merge pull request #38 from bendrucker/is-buffer
  Use is-buffer to detect buffers without the Buffer module
- Update mocha & min version of is-buffer dependencies
- Release v1.6.1
- Do not overwrite falsey key unless overwrite is true.
  Closes #25.
- Release v2.0.0

- travis: add 4.0.0
- Merge pull request #16 from feross/dcousens-patch-1
  travis: add 4.0.0
- badges
- remove `browser: false` env option no-op
- Relax radix rule
  Rule: http://eslint.org/docs/rules/radix.html
  Just tested latest Chrome, Firefox, Safari, and Edge and
  parseInt('071') returns 71 as expected.
  I think we can finally relax this rule. Code that uses parseInt and
  targets really old browsers should still use a radix, but this doesn't
  need to be a rule anymore.
  Discussion: feross/standard#384
- code style
- BREAKING: require eslint 2.0.0
- config changes for eslint 2.0.0
- no-return-assign: make default option explicit
- disallow label usage, even with loops/switch statements
- fix config validation issue
- New rule: Enforce spaces around * in "yield *"
  http://eslint.org/docs/2.0.0/rules/yield-star-spacing
  Fixes feross/standard#335
- enable jsx support for standard 6
  standard v6 will not use the eslint sharable config
  “eslint-config-standard-react” anymore.
  So, let’s add support for jsx syntax in the parser in
  eslint-config-standard.
  Discussion: feross/standard#351
- travis: drop 0.10 and 0.12 support
- New rule: Require parens in arrow function arguments
  http://eslint.org/docs/2.0.0/rules/arrow-parens.html
  Fixes feross/standard#309
- alphabetize package.json keywords
- add promise/param-names rule
  Ensures that new Promise() is instantiated with the parameter names
  resolve, reject.
  Fixes feross/standard#282
- remove duplicate rule
- New rule: Enforce Usage of Spacing in Template Strings (template-curly-spacing)
  http://eslint.org/docs/2.0.0/rules/template-curly-spacing
- New rule: Disallow Symbol Constructor (no-new-symbol)
  http://eslint.org/docs/2.0.0/rules/no-new-symbol
- New rule: Disallow Self Assignment (no-self-assign)
  http://eslint.org/docs/2.0.0/rules/no-self-assign
- New rule: Disallow unnecessary constructor (no-useless-constructor)
  http://eslint.org/docs/2.0.0/rules/no-useless-constructor
- New rule: Disallow string concatenation when using __dirname and __filename (no-path-concat)
  Fixes #403
  http://eslint.org/docs/2.0.0/rules/no-path-concat
- New rule: Disallow empty destructuring patterns (no-empty-pattern)
  http://eslint.org/docs/2.0.0/rules/no-empty-pattern
- move jsx-quotes rule from eslint-config-standard-react
- readme
- test: fix for eslint 2
- 5.0.0
- fix tests
- lock to latest versions
- peer depend on eslint
- 5.1.0
bd1cf63
@mike-engel

Looks like I'm a little late to the party, but I'd like to propose adding "jsxPragma" to the standard config.

note: If this should be in a different issue, let me know and I'll continue this in a new one.

Right now, I've got a component using preact (which uses virtual-dom) that requires h instead of React as a global.

import { h, render } from 'preact'
import { IndexRoute, Route, Router } from 'react-router'
import { createHistory } from 'history'
import { App } from './app'
import { Home } from './home'
import { About } from './about'

export const routes = (
  <Route path='/' component={App}>
    <IndexRoute component={Home} />
    <Route path='/about' component={About} />
  </Route>
)

render(<Router history={createHistory}>{routes}</Router>, document.querySelector('[data-hook="app"]'))

Babel allows a config in .babelrc like so:

{
  "jsxPragma": "h"
}

Thus, is might work if standard could have it's jsxPragma set (vs. including the pragma statement on each page) like so in package.json which could be used to ignore the "defined but never used" errors. Should work for any jsx library I would think.

"standard": {
  "jsxPragma": "h"
}
@feross
Owner
feross commented Feb 9, 2016

@mike-engel standard's philosophy is to avoid configuration and opt for in-line documentation. You can set which JSX pragma you're using by adding a comment to the top of your file:

/** @jsx h */
import { h, render } from 'preact'
// etc ...

That should work 👍

@mike-engel

Yeah, I understand @feross. I was coming at it from the angle where instead of having to add the pragma to every file (I don't currently add them, they're inferred as react jsx by default), it would be nice to have one place to add them. It would be the same idea as defining globals in one place vs. adding /* global describe */ to every test file.

I understand the reasoning for keeping it out, however, and it's just a thought.

@feross
Owner
feross commented Feb 9, 2016

@mike-engel Thanks for clarifying what you meant. I still think we'll keep this out of the package.json for now.

@borisirota

@feross just want to add my point of view for maybe additional perspective.

I totally agree that there should be zero configuration using standard. But, as I see it, the pragma isn't a configuration. jsx already baked into standard (this is the configuration) and because there are different virtual dom libraries, jsx users must specify the pragma. So the question is not if to specify but where to specify and to me it seems similar to the parser option because its consistent along the project.

The need of adding additional and same line to all jsx files so a tool (standard) that already supports jsx will understand the input, just doesn't feel 100% to me so IMHO I think @mike-engel suggestion is better than the current state and setting jsxPragma should be part of standard somehow.

@dcousens
Collaborator

It would be the same idea as defining globals in one place vs. adding /* global describe */ to every test file.

Except that is exactly what we think should happen, because anything else means implied context which causes programmer errors and should be avoided.

I like to code by the phrase:

if it is ugly, make it as ugly as possible, unless its beautiful, in which case let it be beautiful

Magical globals do not fall into a beautiful category IMHO.

@borisirota

@dcousens I 100% agree with you.

Maybe I'm wrong but I just don't see the pragma falls into the globals category. As I see it, globals are implicitly defined and explicitly used and in the jsx case it something that explicitly required (not global) but used implicitly.

I thought that jsx support should include the configuration (rules) + pragma definition (setting by the user) because its not complete without the pragma but now I have better understanding about your point of view. Not sure about my opinion.

Is this the only use case for this scenario (explicit require and implicit use) ?

@kvz kvz added a commit to freyproject/frey that referenced this issue Mar 18, 2016
@kvz kvz Upgrade node dependencies
- bump deps
- 3.0.1
- Add missing semicolon
- fix typo
  closes #19
- bump deps
  this is the breaking change: isaacs/node-glob@2f8b6d7
- 4.0.0

- Raise error if cwd is not a directory
  Fix #235
- v7.0.0
- add package name to readme
  Fix #230
- changelog
  Fix #179
- Fix race condition when all patterns are ignored
  Fix #232
- v7.0.1
- Properly exclude dirs using nodir when root is set
  Fix #221
- update tap to 5.7.0
- v7.0.2
- test: fix some paths for windows
- remove incorrect absolute-ness check in makeAbs
- Prevent incorrect nodir results on Windows
  Ensure that everything in the cache always uses correct slashes, and
  always test against absolute paths when checking anything in the cache.
- optimization: only abs the cwd once
- v7.0.3

- travis: add 4.0.0
- Merge pull request #16 from feross/dcousens-patch-1
  travis: add 4.0.0
- badges
- remove `browser: false` env option no-op
- Relax radix rule
  Rule: http://eslint.org/docs/rules/radix.html
  Just tested latest Chrome, Firefox, Safari, and Edge and
  parseInt('071') returns 71 as expected.
  I think we can finally relax this rule. Code that uses parseInt and
  targets really old browsers should still use a radix, but this doesn't
  need to be a rule anymore.
  Discussion: feross/standard#384
- code style
- BREAKING: require eslint 2.0.0
- config changes for eslint 2.0.0
- no-return-assign: make default option explicit
- disallow label usage, even with loops/switch statements
- fix config validation issue
- New rule: Enforce spaces around * in "yield *"
  http://eslint.org/docs/2.0.0/rules/yield-star-spacing
  Fixes feross/standard#335
- enable jsx support for standard 6
  standard v6 will not use the eslint sharable config
  “eslint-config-standard-react” anymore.
  So, let’s add support for jsx syntax in the parser in
  eslint-config-standard.
  Discussion: feross/standard#351
- travis: drop 0.10 and 0.12 support
- New rule: Require parens in arrow function arguments
  http://eslint.org/docs/2.0.0/rules/arrow-parens.html
  Fixes feross/standard#309
- alphabetize package.json keywords
- add promise/param-names rule
  Ensures that new Promise() is instantiated with the parameter names
  resolve, reject.
  Fixes feross/standard#282
- remove duplicate rule
- New rule: Enforce Usage of Spacing in Template Strings (template-curly-spacing)
  http://eslint.org/docs/2.0.0/rules/template-curly-spacing
- New rule: Disallow Symbol Constructor (no-new-symbol)
  http://eslint.org/docs/2.0.0/rules/no-new-symbol
- New rule: Disallow Self Assignment (no-self-assign)
  http://eslint.org/docs/2.0.0/rules/no-self-assign
- New rule: Disallow unnecessary constructor (no-useless-constructor)
  http://eslint.org/docs/2.0.0/rules/no-useless-constructor
- New rule: Disallow string concatenation when using __dirname and __filename (no-path-concat)
  Fixes #403
  http://eslint.org/docs/2.0.0/rules/no-path-concat
- New rule: Disallow empty destructuring patterns (no-empty-pattern)
  http://eslint.org/docs/2.0.0/rules/no-empty-pattern
- move jsx-quotes rule from eslint-config-standard-react
- readme
- test: fix for eslint 2
- 5.0.0
- fix tests
- lock to latest versions
- peer depend on eslint
- 5.1.0
f0e9297
@kvz kvz added a commit to transloadit/uppy that referenced this issue Apr 7, 2016
@kvz kvz Upgrade Hexo
- Allow users to set the per_page option to 0
- 0.1.3 released
- bugfix for archive disabled pagination
  when archive disabled pagination, per_page should be 0.
- fix typo
- Merge pull request #1 from wileam/patch-1
  bugfix for archive disabled pagination
- add archive daily
- add tests
- Merge pull request #2 from huanz/master
  add archive daily
- Replace JSHint with ESLint and JSCS
- 0.1.4 released

- Fix: cannot deploy when src refspec is not master
- Use HEAD src refspec to fix the problem
- Merge pull request #4 from h404bi/master
  Fix: cannot deploy when src refspec is not master
- Update README.md
  Clarify `branch` option
- Use ESLint and JSCS
- Set global git config for CI
- 0.1.0 released

- Allow users to set the per_page option to 0
- Merge pull request #2 from borisschapira/master
  Allow users to set the per_page option to 0
- 0.1.3 released

- Set scrolling="no" to make iframe responsive
  the fiddle iframe is not responsive in iOS safari and Chrome. By setting `scrolling="no"` makes it possible to fix this issue, by setting `width=1px; min-width=100%` in CSS. [See StackOverflow](http://stackoverflow.com/questions/23083462/how-to-get-an-iframe-to-be-responsive-in-ios-safari)
- fixed #1105
- Merge pull request #1345 from anjianshi/master
  fixed #1105 make url_for() handle "/" correctly
- New date helper using momentjs 'fromNow' method
  Moment.js provides a quite useful function for relative time, it would be a shame not to use it ;)
- Explicit comparisons
- Do not compare undefined with null, explicit the cas instead
- Decorrelate fromNow from output
- date_fromNow tests
- Now there is a function that apply locale and timezone and each helper format the date
- [helper] add log()
  Good for logging objects in theme and plugin
  originally #1389
   Changes to be committed:
  	modified:   lib/plugins/helper/debug.js
  	modified:   lib/plugins/helper/index.js
  	new file:   test/scripts/helpers/debug.js
  	modified:   test/scripts/helpers/index.js
- Merge pull request #1391 from leesei/master
  [helper] add log()
- Prepend root path to urlForHelper
  When user configures a prefix path as root path, urlForHelper can not
  resolve url like '/archives' correctly with the prefix root path.
  Resolves: #1105
- Merge pull request #1406 from liuhongjiang/add_root_to_urlForHelper
  Prepend root path to urlForHelper
- now hexo list post will show category and tag what post been
- add hexo list category(cate)
- fix CI error
- Modify the error
  Modify tag_id to category_id in line 153.
- Use ESLint and JSCS instead of JSHint. Fix tests failed on Node.js 4
- Fix coding style
- Add contributing guide
- fix: #1451: more cannot work in almost all themes
- fix "date" attribute default value
- fix relative_url
- fix: #1451: more cannot work in almost all themes
- Merge branch 'fix_more_excerpt' of https://github.com/amobiz/hexo into HEAD
- added line_number flag to code block, allowing for independent enabling/disabling of line numbers for each block
- restricted trimming of tag bodies to the (presumably intended) cleaning up of occasionally parser-inserted extraneous line breaks.
- added test
- Merge pull request #1539 from aausch/correct_tag_trimming
  Correct tag trimming
- might as well add a configuration option to enable/disable highlight all together.
- unit test for highlight disable option
- unit test for line_number option.
- Fix https warning
  When blog is on https, there is warning if all resources are not on https...
- Fix HTML issue with RSS/Atom feeds: rel="alternate"
  According to the W3C, "alternative" is not a valid value for attribute "rel" on
  element "link". The HTML5 standard uses <link rel="alternate" to provide an
  alternate representation, such as RSS or Atom.
- Merge pull request #1572 from vhf/feed-tag-fix
  Fix HTML issue with RSS/Atom feeds: rel="alternate"
- Merge pull request #1561 from nemanjan00/patch-1
  Fix https warning
- Merge pull request #1524 from zoubin/bugfix-relative_url
  fix relative_url
- Merge pull request #1519 from amobiz/fix_more_excerpt
  Fix more excerpt
- Fix gravatar helper tests failed and update deps
- Merge pull request #1538 from aausch/block_configurable_line_numbers
  override line_number, highlight settings at the codeblock level
- Merge pull request #1512 from Gtskk/patch-1
  Modify the error
- Merge pull request #1523 from aulphar/master
  fix "date" attribute default value #1522
- Merge branch 'master' of https://github.com/XGHeaven/hexo into XGHeaven-master
  # Conflicts:
  #	lib/plugins/console/list/post.js
- Merge branch 'XGHeaven-master'
- Make JSCS happy
- Fix the issue that we cannot use space in tag parameter which wrapped with double quote mark
- fix the syntax warning
- Fix the issue of jscs error
- Fix post list console
- Add abbrev. support for list console
- Update hero-util to 0.2.1
- Merge branch 'master' of https://github.com/borisschapira/hexo into borisschapira-master
  # Conflicts:
  #	lib/plugins/helper/date.js
  #	test/scripts/helpers/date.js
- Rename date_fromNow helper to relative_date
- Disable auto detect for highlight by default
- Replace sha1 with xxHash for faster checksum
- Lazy load file hash
  - Load file hash only if the file is new or the modified time is changed
  - Lock the file when resolving the cache
- Use g++-4.8 on Travis. Remove Node.js 0.10 build and add Node.js 5.
- Use xxhash as optional dependency
- Update warehouse to 2.0.0
- Detect the current category/tag in `is_category/tag` helper. Resolve #1278
- Fix Sha1Stream return raw buffer
- Always use xxhash
- 3.2.0-beta.1 released
- tag: fix special tag names
- jscs --fix
- add option for first line number to tag.js
- add option for first line number to test
- delete extra blank line.
- Use Promise.each in box process to prevent race condition
- Use eslint-plugin-hexo and jscs-preset-hexo
- Speed improvements
  Changes:
  - Rewrite Box.
    - Process files during loading file list.
    - Delay file hash check. Use File.changed() to check if file changed.
    - Remove watch delay.
    - Parallel processing.
  - Save rendered content in warehouse. It really saves a lot of time.
  - Rewrite generate console.
    - Cache rendered content so we don't have to render it again.
    - Load file list from cache. Don't delete other files in public folder. Resolve #1310
    - Remove file stat check.
    - Parallel generating.
  - Resolve race conditions.
  Known issues:
  - Parallel processing and parallel generating may cause race conditions. We have to solve this in warehouse.
  - Tests are not updated yet.
- Merge pull request #1607 from rhykw/add-firstLine-option-to-tag-plugin
  Added `first_line` option to codeblock
- Merge pull request #1599 from magicdawn/fix-special-tags
  tag: fix special tag names
- Merge pull request #1305 from tjwudi/master
  Set scrolling="no" to make iframe responsive
- Merge pull request #1581 from winterTTr/master
  Fix issue cannot correctly analyze arguments with space in tag
- Fix box tests. Emit processBefore & processAfter on Box instead of Hexo context.
- Bug fixes.
  - Fix all other tests.
  - Listen to processAfter event of boxes.
  - Fix generate console not write file if not exist
  - Allow non-json file in data processor
  - Remove post asset if post was removed
- Update hexo-util@0.3.0 and fix box tests on Linux
- Merge branch 'new-box'
- Fix JSCS error
- Ignore node_modules folder in theme folder. Resolve #1316
- Implement include/exclude files
- Merge config instead of extend
- 3.2.0-beta.2 released
- 解决code中存在类似swig语法被错误解析的问题
- Add headerlink for post render test cases
  - Update hexo-renderer-marked version
- Ignore milliseconds for the post test cases
- Fix cache key name error for box file test cases
- Merge pull request #1668 from liuhongjiang/fix-test-errors
  Fix test errors
- Merge pull request #1652 from ksky521/master
  解决code中存在类似swig语法被错误解析的问题
- Support root path configure for img tag
  Current img tag doesn't prepend root path if it's not a slash. With
  this fix, the root path will be prepend to the img src if it's not a
  slash.
  This fix only works for the hexo tags, does not work for the markdown
  syntax of links and images. The issues of markdown links and images should
  be fixed in the hexo-renderer-marked module.
  Resolves: #1440
- Add root path to permalink of post
  This commit fixs this problem, when the root path is set to a
  subdirectory, there is no this root path in the permalink of post.
- Merge pull request #1444 from liuhongjiang/prepend-root-to-img-tag
  Support root path configure for img tag
- OpenGraph: added support for twitter image attribute
- trim() instead of regular expression
- keywords supported in open_graph
- Update license date
- Merge pull request #1697 from timwangdev/patch-2
  Happy new year!
- Remove unneccessary refs to type attr in helper output snippets.
  See Issue #1695: hexojs/hexo#1695
  Also see the HTML5 Spec section on the type attr:
  http://dev.w3.org/html5/spec-preview/Overview.html#attr-link-type
  In short, the use of type tags is purely advisory, and the
  spec instructs browsers to infer the resource type before fetching
  them. In cases where the inference does not match the declaration,
  the resource will not be loaded. When the declaration is left off,
  the resource will load. It appears generally safer to leave the tags
  off entirely.
- Revise tests to not expect type attrs in generated link/script tags.
- url_for helper: Don't prepend root if url is started with #
  Fix #1708
- Ignore empty categories/tags. Fix #1704
- Fix skip_render doesn't work in asset generator
- Allow specify plugin list in config. Resolve #1670
- Merge pull request #1706 from brycepj/1695-html5-type-remove
  Remove unneccessary refs to type attr in helper output snippets
- Merge pull request #1681 from giuseppelt/giuseppelt-og-twitter
  OpenGraph: added support for twitter image attribute
- Merge pull request #1683 from yanni4night/master
  keywords supported in open_graph
- Update deps
- Make linter happy
- Use hero-log and remove commands exist in hexo-cli
- Replace Swig in post.create
- Remove bunyan
- Add tests for config console
- Update debug helper test with rewire
- Update appveyor.yml
- View render improvements
  - Use _.assign instead of _.extend
  - Simplify View.prototype._buildLocals
  - Precompile theme templates if possible
- Update dependencies
- Fix category path when placed on root
  This patch fixes the double slashes (http://site.com//cat1) in the category path, when you configure `category_dir` with '/' or ''
- Merge branch 'giuseppelt-patch-1'
- [fix] don't urlescape path of post asset
  fixes #1562
  Changes to be committed:
  	modified:   lib/models/post_asset.js
  	modified:   test/scripts/tags/asset_img.js
- [test] add spaced asset test for all post asset tags
  Changes to be committed:
  	modified:   test/scripts/tags/asset_img.js
  	modified:   test/scripts/tags/asset_link.js
  	modified:   test/scripts/tags/asset_path.js
- [chore] make linter happy
- [test] add test for number of lines in code block
   Changes to be committed:
  	modified:   test/scripts/tags/code.js
- test(processor/post): should compare with birthtime
- add mark option to code blocks
  closes #1766
- test(tags/code): update mark test
   Changes to be committed:
  	modified:   test/scripts/tags/code.js
- lint(tags/code): make linter happy
   Changes to be committed:
  	modified:   lib/plugins/tag/code.js
  	modified:   test/scripts/tags/code.js
- Load file status before Box.process
  - Remove File.changed method
  - There's no big difference to load file status in demand so I bring back file type "skip".
- Fix tests failed on Windows since the incorrect path separator
- Add test for Swig template compile
- 3.2.0 released

- fixes hexojs/hexo#1297
- Merge pull request #1 from borisschapira/master
  fixes hexojs/hexo#1297
- 0.1.3 released
- Custom order for posts
- Update README
- Merge pull request #3 from iissnan/order-customization
  Custom order for posts
- Replace JSHint with ESLint and JSCS
- 0.2.0 released

- Allow users to set the per_page option to 0
- Merge pull request #1 from borisschapira/master
  Allow users to set the per_page option to 0
- 0.1.2 released
- allow to generate tag index page
- update test for tag index page
- Merge pull request #2 from creeperyang/AddIndexPage
  Add Tag index page
- Use eslint-config-hexo and jscs-preset-hexo
- 0.2.0 released

- Add tests
- 0.1.1 released
- Add support for template precompile
- 0.2.0 released

- Use opn instead. Don't watch files in static mode.
- Use eslint-config-hexo and jscs-preset-hexo
- added process.env.port to facilitate configuration through process management utils (pm2/strongloop/forever/heroku). follows express convention
- Merge pull request #16 from EvanCarroll/master
  added process.env.port to facilitate configuration through process ma…
- 0.1.3 released
- Update appveyor.yml
- Add options and some improvements
  - Add "compress" option: Enable GZIP compression
  - Add "header" option: Add "X-Powered-By: Hexo" header
  - Display "0.0.0.0" as "localhost"
  - Use supertest-promised in tests
- Make linter happy
- Install superset as well
- 0.2.0 released

- Update readme
- Upgrade dependencies. Fixes DoS in marked.
  Closes #3
- Merge pull request #14 from rstoenescu/master
  Upgrade dependencies. Fixes DoS in marked.
- headerlink
- mocha test error fix
- Merge pull request #15 from ksky521/master
  headerlink
- Use eslint-config-hexo and jscs-preset-hexo
- 0.2.6 released
- Strip html from headerlink title
- add unit test for header links
- Merge pull request #17 from cgmartin/patch-1
  Strip html from headerlink title
- 0.2.7 released
- Prepend root path to img and link
  In hexo configuration, if the root path is set to a sub directory, hexo
  should prepend this root path to img and link of markdown syntax.
  Resolves: hexojs/hexo#1440
- Merge pull request #7 from liuhongjiang/prepend-root-to-img-link
  Prepend root path to img and link
- 0.2.8 released
- No prefix for anchor links
  Inserting links to headings directly from markdown is common practice. `[jump to title](#title)` should not become a full-blown URL on markdown rendering. It should instead be rendered as-is: `<a href="#title">jump to title</a>`.
- Merge pull request #21 from vhf/no-prefix-for-anchor-links
  No prefix for anchor links
- Don't prepend root path to links
- 0.2.9 released
- Use slugize method of hexo-util to fix Chinese headers can't be handle properly
- 0.2.10 released

- travis: add 4.0.0
- Merge pull request #16 from feross/dcousens-patch-1
  travis: add 4.0.0
- badges
- remove `browser: false` env option no-op
- Relax radix rule
  Rule: http://eslint.org/docs/rules/radix.html
  Just tested latest Chrome, Firefox, Safari, and Edge and
  parseInt('071') returns 71 as expected.
  I think we can finally relax this rule. Code that uses parseInt and
  targets really old browsers should still use a radix, but this doesn't
  need to be a rule anymore.
  Discussion: feross/standard#384
- code style
- BREAKING: require eslint 2.0.0
- config changes for eslint 2.0.0
- no-return-assign: make default option explicit
- disallow label usage, even with loops/switch statements
- fix config validation issue
- New rule: Enforce spaces around * in "yield *"
  http://eslint.org/docs/2.0.0/rules/yield-star-spacing
  Fixes feross/standard#335
- enable jsx support for standard 6
  standard v6 will not use the eslint sharable config
  “eslint-config-standard-react” anymore.
  So, let’s add support for jsx syntax in the parser in
  eslint-config-standard.
  Discussion: feross/standard#351
- travis: drop 0.10 and 0.12 support
- New rule: Require parens in arrow function arguments
  http://eslint.org/docs/2.0.0/rules/arrow-parens.html
  Fixes feross/standard#309
- alphabetize package.json keywords
- add promise/param-names rule
  Ensures that new Promise() is instantiated with the parameter names
  resolve, reject.
  Fixes feross/standard#282
- remove duplicate rule
- New rule: Enforce Usage of Spacing in Template Strings (template-curly-spacing)
  http://eslint.org/docs/2.0.0/rules/template-curly-spacing
- New rule: Disallow Symbol Constructor (no-new-symbol)
  http://eslint.org/docs/2.0.0/rules/no-new-symbol
- New rule: Disallow Self Assignment (no-self-assign)
  http://eslint.org/docs/2.0.0/rules/no-self-assign
- New rule: Disallow unnecessary constructor (no-useless-constructor)
  http://eslint.org/docs/2.0.0/rules/no-useless-constructor
- New rule: Disallow string concatenation when using __dirname and __filename (no-path-concat)
  Fixes #403
  http://eslint.org/docs/2.0.0/rules/no-path-concat
- New rule: Disallow empty destructuring patterns (no-empty-pattern)
  http://eslint.org/docs/2.0.0/rules/no-empty-pattern
- move jsx-quotes rule from eslint-config-standard-react
- readme
- test: fix for eslint 2
- 5.0.0
- fix tests
- lock to latest versions
- peer depend on eslint
- 5.1.0

- Appveyor yml file
- remove unnecessary options object manipulation
- v6.0.2
- Revert "remove unnecessary options object manipulation"
  This reverts commit eb6319ff50ae8ef4f9f287fdd4d8f67ba083bba2.
  Turns out those options ARE relevant, for Minimatch, though not for
  glob.  Oh well.
  Fix #239
- v6.0.3
- update badges to add appveyor and coveralls
  remove david-dm, since I don't really get much value out of it.  I run
  'npm outdated' enough to find issues.
- add node 5 to travis-ci
- simplify appveyor.yml file
  Also adds a few details that make things go faster
- Upgrade to tap@4
  Required a slight change since Istanbul now includes a
  fs.readdirSync(), which triggered the ENOTSUP test monkeypatch.
- Fix appveyor install of node
  Thanks @appveyor support!
- remove util._extend
  fix #240
- tap@5
- v6.0.4
- Raise error if cwd is not a directory
  Fix #235
- v7.0.0
- add package name to readme
  Fix #230
- changelog
  Fix #179
- Fix race condition when all patterns are ignored
  Fix #232
- v7.0.1
- Properly exclude dirs using nodir when root is set
  Fix #221
- update tap to 5.7.0
- v7.0.2
- test: fix some paths for windows
- remove incorrect absolute-ness check in makeAbs
- Prevent incorrect nodir results on Windows
  Ensure that everything in the cache always uses correct slashes, and
  always test against absolute paths when checking anything in the cache.
- optimization: only abs the cwd once
- v7.0.3
8620d43
@jsonmaur
jsonmaur commented Dec 1, 2016

@mike-engel What's the workaround you're using for Preact (if you found one)? As of right now, standardjs seems unusable for a preact app since it catches every instance of h as unused. And I'm not adding /** @jsx h */ to every component file, that seems unreasonable.

@mike-engel

@jsonmaur preact didn't end up working back then for what we needed, so we never had to support standard + preact together

@feross
Owner
feross commented Dec 3, 2016

I am using Preact in a new app I'm building. Right now, I'm just adding /** @jsx h */ to the top of every component file. It's not that bad.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment