dillon1000/react
Commit
Browse files 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.
Changed paths11 files
First-parent comparison.eslintrc ModifiedM Gruntfile.js ModifiedA eslint-rules/__tests__/warning-and-invariant-args-test.js AddedA eslint-rules/warning-and-invariant-args.js AddedM grunt/tasks/eslint.js ModifiedA grunt/tasks/test-eslint-rules.js AddedM package.json ModifiedM src/addons/ReactFragment.js ModifiedM src/isomorphic/classic/element/ReactElementValidator.js ModifiedM src/renderers/dom/client/ReactMount.js ModifiedM src/renderers/shared/reconciler/ReactInstanceHandles.js ModifiedPatch
Files changed
Rendering syntax-highlighted changes…