Commit Graph

1162 Commits

Author SHA1 Message Date
Jordan Harband
aa4e9c466a [eslint config] [base] [breaking] enable no-tabs 2016-09-06 01:07:39 -07:00
Jordan Harband
27dcb99c6d [eslint config] [base] [breaking] enable func-call-spacing 2016-09-06 01:07:16 -07:00
Jordan Harband
086cc0035d [eslint config] [base] [breaking] enable no-template-curly-in-string
- Also, clean up rule documentation.
2016-09-06 00:36:04 -07:00
Jordan Harband
c829114a41 Merge pull request #1047 from airbnb/css-in-js
[guide] Add CSS-in-JavaScript section
2016-09-02 13:21:10 -07:00
Joe Lencioni
c6406330ea Add note about where where mystery objects come from
As @ljharb pointed out, we are using some functions like `css()` and
`withStyles()`, but make no mention of what they are or where they come
from. Since they come from react-with-styles, let's make this clear.
2016-09-02 07:57:33 -07:00
Joe Lencioni
c74caead2a Re-order breakpoints in CSS-in-JS document
This is more "mobile first".
2016-09-01 09:49:21 -07:00
Joe Lencioni
71a2b12262 Add CSS-in-JavaScript section
We have been writing CSS in JavaScript and have developed a set of best
practices around this type of thing. I thought it would be nice to
publish this document alongside our other JavaScript style guide
documents.
2016-09-01 09:49:21 -07:00
Jordan Harband
3a7210eac1 [guide] remove subtle endorsement of JSDoc-style commenting. 2016-08-31 21:54:51 -07:00
Jordan Harband
0e4517ea38 [eslint config] [patch] set ignoreCase to true in disabled rules.
When/if these rules are enabled, we will want to ignore case.

This also helps https://github.com/pinterest-web/eslint-config-pinterest/pull/46/files#r76165293
2016-08-29 00:11:52 -07:00
Thomas Marek
a43c16e330 Explain why not to prefix methods with underscores 2016-08-29 18:19:22 -04:00
Heejong Ahn
6944be009c Fix a typo in commas section
Example code block following blockquote(line 2223) was broken as a line break was missing. So I just added single blank line.
2016-08-28 23:09:11 +09:00
Harrison Shoff
1541503fd4 [7.1] add link to fn names discussion. fixes #794 2016-08-25 21:48:31 -07:00
Jordan Harband
48f477db2a [eslint config] [base] [patch] remove redundant DebuggerStatement from no-restricted-syntax
Fixes #1031.
2016-08-23 15:19:34 -07:00
Jordan Harband
21846f6da0 [guide] fix “long lines” example to not include strings.
Fixes #1027.
2016-08-23 15:07:42 -07:00
Jordan Harband
ca1124cd8d [eslint config] [base] v5.0.3 eslint-config-airbnb-base-v5.0.3 2016-08-21 23:25:19 -07:00
Yang Su
2e694723bf Changed ESLint rule configs to use 'off', 'warn', and 'error' instead of numbers for better readability 2016-08-20 15:36:57 -07:00
Jordan Harband
f1fedfa7ca ES2015 2016-08-18 23:08:45 -07:00
soul-wish
baf0fa5343 fix issue with eslint-config-airbnb README.md file formatting 2016-08-18 22:35:42 +03:00
Joe Lencioni
39d5559b9a Remove misleading reference to one-var eslint rule
This eslint rule does not enforce this style guide rule. I believe that
referencing it here will cause people to believe that this is enforced
via linting when it is not. As far as I know, there is no rule that
currently enforces this, but it would be nice to add one.
2016-08-18 10:35:23 -07:00
Olivier G
41623039e8 Typo : text link to 13.5 was not working (#1020) 2016-08-18 08:33:23 -07:00
Jordan Harband
3ad33681a7 [eslint config] [*] [deps] update eslint, eslint-plugin-react 2016-08-18 00:50:37 -07:00
Aniruddh Agarwal
b126016410 Add section on variable assignment chaining 2016-08-18 13:48:58 +08:00
Gerardo Renovales
e92eaef4e2 Update README.md
Add M2GEN to the list
2016-08-17 19:46:55 -04:00
Jordan Harband
db2e7bdf63 [eslint config] [base] [fix] correct import/extensions list.
From b45fdcd60f / fixes #1013.
2016-08-15 23:17:04 -07:00
Jordan Harband
424d74ec8d [eslint config] [deps] update eslint-plugin-react 2016-08-15 00:21:39 -07:00
Jordan Harband
3fb9f2ec69 [eslint config] v10.0.1 eslint-config-airbnb-v10.0.1 2016-08-12 15:52:10 -07:00
Jordan Harband
7d9af14ce4 [eslint config] [deps] update eslint, eslint-plugin-jsx-a11y, eslint-plugin-import, eslint-config-airbnb-base
- add temp disabled `jsx-a11y/anchor-has-content` rule
2016-08-12 15:49:45 -07:00
Jordan Harband
be6e13f7b9 [eslint config] [base] v5.0.2 eslint-config-airbnb-base-v5.0.2 2016-08-12 15:38:44 -07:00
Jordan Harband
fb0f03f676 [eslint config] [base] [deps] update eslint, eslint-plugin-import
- add temp disabled `func-call-spacing` rule
 - add temp disabled `no-template-curly-in-string` rule
 - enable `no-global-assign` and deprecate `no-native-reassign`
 - enable `no-unsafe-negation` and deprecate `no-negated-in-lhs`
 - add disabled `sort-keys` rule
2016-08-12 15:36:56 -07:00
Jordan Harband
0b8e466397 [eslint config] [*] [deps] update eslint, eslint-find-rules 2016-08-09 09:08:49 -07:00
Mitsuru Ogawa
d20f33f660 Add link for Japanese translation 2016-08-09 19:06:43 +09:00
Maxim
646fa70f59 Update README.md 2016-08-08 11:14:05 +03:00
felipethome
31265099af [guide] Simplify the examples of 'apply vs spread' topic 2016-08-05 18:38:35 -03:00
felipethome
c7d34b526a [guide] Add a topic about spread operator vs apply 2016-08-05 11:52:41 -03:00
felipethome
030598db09 [guide] Add ESlint rules to 'always use const' and 'decriptive variable names' topics 2016-08-04 14:13:12 -03:00
Joe Lencioni
dc7e7e77f2 Reverse rule on string concatenation for long lines (#995)
Broken and concatenated long strings are painful to work with and
produce less readable and searchable code. I think we should reverse
this rule.

Unfortunately, the max-len rule currently does not allow for this, but
there is currently a proposal to add an option to ESLint's max-len rule
that would allow for strings to be ignored.

  https://github.com/eslint/eslint/issues/5805

There have also been discussions around performance of string
concatenation (https://github.com/airbnb/javascript/issues/40), but I
don't think that is very relevant here so I removed the links to them.
2016-08-04 09:53:09 -07:00
Joe Lencioni
6d2fc89bd1 Add template literal "bad" example to single quotes guideline
There has been some confusion around whether we should use single quotes
or template literals. To help avoid this confusion, I am adding a "bad"
example to the single quotes guideline. This rule is already enforced by
the quotes linter rule.

Generally, we want code to clearly express developer intention. Using
template literals communicates that you intend to use some of the
features that template literals offer (e.g. interpolation).

Fixes #992
2016-08-04 09:38:12 -07:00
Joe Lencioni
bfc842e3ad Remove rules about reserved words
In 53b4173b we removed the ES5 guide which contains a lot of guidelines
that are no longer very relevant for us. Similarly, some folks have
raised the relevance of these rules about reserved words, given that we
are now living in an age where ES3 support has mostly waned and
transpilers such as Babel are widely adopted and pave over these issues.
This seems like a good opportunity to simplify.

Fixes #61
2016-08-03 14:41:16 -07:00
felipethome
f0b31960d3 [guide] Add eslint rules to function declaration and function constructor topics 2016-08-03 16:20:22 -03:00
felipethome
f94f6e21c6 [guide] Add eslint rule to spacing in a function signature topic
[guide] Add eslint rules to spacing in a function signature topic
2016-08-02 20:49:54 -03:00
Jordan Harband
6454839e76 [guide] Use var in reserved word examples, since they refer to untranspiled code. 2016-08-01 23:56:37 -07:00
Joe Lencioni
52a2da4182 Add curlies around ref function body
The example we have here uses an implicit return, which is forbidden
when assigning. This triggers the no-return-assign rule.

Fixes #980
2016-08-02 09:09:12 -07:00
Jordan Harband
9ffadff1fd [eslint config] v10.0.0 eslint-config-airbnb-v10.0.0 2016-08-01 13:53:30 -07:00
Jordan Harband
a1edac348a [eslint config] [*] add safe-publish-latest to prepublish 2016-08-01 14:05:32 -07:00
Jordan Harband
53b4173b04 [guide] [es5] Remove ES5 guide and mark it deprecated.
Fixes #941.
2016-07-06 18:13:13 -07:00
Jordan Harband
b4d8543f12 [eslint config] [react] [breaking] enable jsx-a11y rules:
- `jsx-a11y/heading-has-content`
 - `jsx-a11y/html-has-lang`
 - `jsx-a11y/lang`
 - `jsx-a11y/no-marquee`
 - `jsx-a11y/scope`
 - `jsx-a11y/href-no-hash`
 - `jsx-a11y/label-has-for`
es5-deprecated
2016-07-05 13:38:57 -07:00
Jordan Harband
a6da4bb5b2 [eslint config] [react] [breaking] enable aria rules:
- `jsx-a11y/aria-props`
 - `jsx-a11y/aria-proptypes`
 - `jsx-a11y/aria-unsupported-elements`
 - `jsx-a11y/role-has-required-aria-props`
 - `jsx-a11y/role-supports-aria-props`
2016-07-05 13:36:21 -07:00
Jordan Harband
6857f7af97 [eslint config] [react] [breaking] enable react rules:
- `react/jsx-filename-extension`
 - `react/jsx-no-comment-textnodes`
 - `react/jsx-no-target-blank`
 - `react/require-extension`
 - `react/no-render-return-value`
 - `react/no-find-dom-node`
 - `react/no-deprecated`
2016-07-05 13:20:39 -07:00
Jordan Harband
cb36ed90c3 [eslint config] [deps] [breaking] update eslint to v3, eslint-config-airbnb-base to v5, eslint-find-rules, eslint-plugin-import, eslint-plugin-jsx-a11y to v2, eslint-plugin-react to v6, tape.
- drop node < 4 support
2016-07-05 13:15:51 -07:00
Zane Mountcastle
75c961a43f Change 'Brazilian' to 'Portuguese' 2016-08-01 10:41:15 +08:00