Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 5 additions & 8 deletions rules/react-a11y.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ module.exports = {
'jsx-a11y',
'react'
],
ecmaFeatures: {
jsx: true
},
rules: {
// Enforce that anchors have content
// https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/anchor-has-content.md
Expand All @@ -31,19 +28,19 @@ module.exports = {

// disallow href "#"
// https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/href-no-hash.md
'jsx-a11y/href-no-hash': [2, ['a']],
//'jsx-a11y/href-no-hash': [2, ['a']],

// Require <img> to have a non-empty `alt` prop, or role="presentation"
// https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/img-has-alt.md
'jsx-a11y/img-has-alt': 2,
//'jsx-a11y/img-has-alt': 2,

// Prevent img alt text from containing redundant words like "image", "picture", or "photo"
// https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/img-redundant-alt.md
'jsx-a11y/img-redundant-alt': 2,

// require that JSX labels use "htmlFor"
// https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/label-has-for.md
'jsx-a11y/label-has-for': [2, ['label']],
'jsx-a11y/label-has-for': [2, { "components": ["label"] }],

// require that mouseover/out come with focus/blur, for keyboard-only users
// TODO: evaluate
Expand Down Expand Up @@ -84,7 +81,7 @@ module.exports = {

// ensure <hX> tags have content and are not aria-hidden
// https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/heading-has-content.md
'jsx-a11y/heading-has-content': [2, ['']],
'jsx-a11y/heading-has-content': [2, { "components": [''] }],

// require HTML elements to have a "lang" prop
// https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/html-has-lang.md
Expand All @@ -96,7 +93,7 @@ module.exports = {

// prevent marquee elements
// https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/no-marquee.md
'jsx-a11y/no-marquee': 2,
//'jsx-a11y/no-marquee': 2,

// only allow <th> to have the "scope" attr
// https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/scope.md
Expand Down
13 changes: 7 additions & 6 deletions rules/react.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ module.exports = {
jsx: true,
},
},
ecmaFeatures: {
jsx: true
},

// View link below for react rules documentation
// https://github.com/yannickcr/eslint-plugin-react#list-of-supported-rules
Expand Down Expand Up @@ -170,7 +167,7 @@ module.exports = {

// Restrict file extensions that may be required
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/require-extension.md
'react/require-extension': [2, { extensions: ['.jsx', '.js'] }],
//'react/require-extension': [2, { extensions: ['.jsx', '.js'] }],

// Require render() methods to return something
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/require-render-return.md
Expand All @@ -181,8 +178,12 @@ module.exports = {
'react/self-closing-comp': 2,

// Enforce spaces before the closing bracket of self-closing JSX elements
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-space-before-closing.md
'react/jsx-space-before-closing': [2, 'always'],
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-tag-spacing.md
'react/jsx-tag-spacing': [2, {
closingSlash: "never",
beforeSelfClosing: "always",
afterOpening: "never"
}],

// Enforce component methods order
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/sort-comp.md
Expand Down