Commit Graph

6 Commits

Author SHA1 Message Date
Sophie Alpert
080db9d3a7 15.x: File headers BSD+Patents -> MIT 2017-09-25 17:02:43 -07:00
Rick Beerendonk
bef45b0b1a Year-agnostic copyright message, like React Native uses, to prevent the need for yearly changes. 2015-12-29 20:20:32 +01:00
Paul O’Shannessy
ecb34de574 Upgrade ESLint, fix code 2015-08-10 17:04:29 -07:00
Benjamin Woodruff
c91fd8ac14 Check warning/invariant calls have good messages
The `warning` implementation checked that the message is long enough to
be useful. See commit f5038829d for more information.

It makes more sense to move this into a lint rule, and also to apply it
for both `warning` and `invariant`. We can safely remove stuff from the
`warning` implementation as we replace the function internally anyways.

https://github.com/facebook/react/pull/4021#issuecomment-108694976
@spicyj
2015-06-04 14:19:22 -07:00
Benjamin Woodruff
aecc48d877 Fix wording of warning-and-invariant-args linter
The wording for an incorrect number of arguments based on counting %s
substitutions. The previous wording was backwards and a bit yoda-like
leading to possible ambiguity.
2015-06-04 10:51:15 -07:00
Benjamin Woodruff
17e7046754 Add custom eslint rule for warning and invariant
See #2869

Checks that the *second* argument of warning and invariant are a literal
string, or a concatination of literal strings, and that the number of
arguments is correct based on the number of %s substrings.

This commit also fixes a few places where the existing code had broken
error messages!

The rule itself is pretty straightforward, although adding the tests
ended up being a bit painful, as eslint-tester depends on mocha, and
therefore needs to be run in a separate grunt task.
2015-06-03 17:19:32 -07:00