diff --git a/.eslintrc b/.eslintrc index 1070878..9b73983 100644 --- a/.eslintrc +++ b/.eslintrc @@ -38,7 +38,7 @@ "no-use-before-define": [2, "nofunc"], "no-unused-vars": "warn", "object-shorthand": 1, - "quotes": [2, "single"], + "quotes": [2, "single", { "allowTemplateLiterals": true }], "react/forbid-prop-types": [1, { "forbid": ["any"] }], // used in conjunction with the transform-react-remove-prop-types babel plugin "react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx"] }], "react/jsx-indent": ["error", 4], @@ -46,7 +46,7 @@ "react/jsx-uses-react": 2, "react/jsx-uses-vars": 2, "react/no-find-dom-node": "warn", // TODO: change this to error and fix findings - "react/prop-types": 0, // not currently working for stateless components: https://github.com/yannickcr/eslint-plugin-react/issues/803 + "react/prop-types": "error", "react/react-in-jsx-scope": 2, "strict": [2, "never"], "vars-on-top": "error" diff --git a/docs/rules/tabindex-no-positive.md b/docs/rules/tabindex-no-positive.md new file mode 100644 index 0000000..9049367 --- /dev/null +++ b/docs/rules/tabindex-no-positive.md @@ -0,0 +1,32 @@ +# tabindex-no-positive + +It is recommended that authors avoid positive values for the `tabindex` attribute because it is +brittle (any focusable elements added to the page without an explicit `tabindex` value greater than +zero will come last in the tab order) and can easily result in a page which is extremely difficult +to navigate, causing accessibility problems. Only use a `tabindex` of 0 for focusable elements. + + +## options + +*This rule takes no options* + +## Passes + +```jsx harmony +
+ + +``` + +## Fails + +```jsx harmony + + + +``` + +## See also + + - [This document](https://github.com/GoogleChrome/accessibility-developer-tools/wiki/Audit-Rules#ax_focus_03) + from Chrome Accessibility Developer Tools. diff --git a/docs/rules/tabindex-uses-button.md b/docs/rules/tabindex-uses-button.md index a966ed6..f681964 100644 --- a/docs/rules/tabindex-uses-button.md +++ b/docs/rules/tabindex-uses-button.md @@ -2,7 +2,7 @@ When an anchor has a `tabIndex`, but no `href` and no `role` properties, it is likely you are using it to emulate a `button`. Prefer using `role="button"` -or just use the `