mirror of
https://github.com/airbnb/javascript.git
synced 2026-01-13 22:08:08 -05:00
[eslint config] [*] Add missing rules
This commit is contained in:
@@ -191,5 +191,16 @@ module.exports = {
|
||||
// Prevent importing the default as if it were named
|
||||
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-named-default.md
|
||||
'import/no-named-default': 'error',
|
||||
|
||||
// Reports if a module's default export is unnamed
|
||||
// https://github.com/benmosher/eslint-plugin-import/blob/d9b712ac7fd1fddc391f7b234827925c160d956f/docs/rules/no-anonymous-default-export.md
|
||||
'import/no-anonymous-default-export': ['off', {
|
||||
allowArray: false,
|
||||
allowArrowFunction: false,
|
||||
allowAnonymousClass: false,
|
||||
allowAnonymousFunction: false,
|
||||
allowLiteral: false,
|
||||
allowObject: false,
|
||||
}],
|
||||
},
|
||||
};
|
||||
|
||||
@@ -188,5 +188,14 @@ module.exports = {
|
||||
tags: [],
|
||||
roles: ['tabpanel'],
|
||||
}],
|
||||
|
||||
// ensure <a> tags are valid
|
||||
// https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/0745af376cdc8686d85a361ce36952b1fb1ccf6e/docs/rules/anchor-is-valid.md
|
||||
// TODO: enable, semver-major
|
||||
'jsx-a11y/anchor-is-valid': ['off', {
|
||||
components: ['Link'],
|
||||
specialLink: [],
|
||||
aspects: ['noHref', 'invalidHref', 'preferButton'],
|
||||
}],
|
||||
},
|
||||
};
|
||||
|
||||
15
packages/eslint-config-airbnb/rules/react.js
vendored
15
packages/eslint-config-airbnb/rules/react.js
vendored
@@ -48,6 +48,11 @@ module.exports = {
|
||||
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-closing-bracket-location.md
|
||||
'react/jsx-closing-bracket-location': ['error', 'line-aligned'],
|
||||
|
||||
// Validate closing tag location in JSX
|
||||
// https://github.com/yannickcr/eslint-plugin-react/blob/9e13ae2c51e44872b45cc15bf1ac3a72105bdd0e/docs/rules/jsx-closing-tag-location.md
|
||||
// TODO: enable, semver-minor
|
||||
'react/jsx-closing-tag-location': 'off',
|
||||
|
||||
// Enforce or disallow spaces inside of curly braces in JSX attributes
|
||||
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-curly-spacing.md
|
||||
'react/jsx-curly-spacing': ['error', 'never', { allowMultiline: true }],
|
||||
@@ -315,6 +320,16 @@ module.exports = {
|
||||
// Prevent void DOM elements from receiving children
|
||||
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/void-dom-elements-no-children.md
|
||||
'react/void-dom-elements-no-children': 'error',
|
||||
|
||||
// Enforce all defaultProps have a corresponding non-required PropType
|
||||
// https://github.com/yannickcr/eslint-plugin-react/blob/9e13ae2c51e44872b45cc15bf1ac3a72105bdd0e/docs/rules/default-props-match-prop-types.md
|
||||
// TODO: enable, semver-minor
|
||||
'react/default-props-match-prop-types': ['off', { allowRequiredDefaults: false }],
|
||||
|
||||
// Prevent usage of shouldComponentUpdate when extending React.PureComponent
|
||||
// https://github.com/yannickcr/eslint-plugin-react/blob/9e13ae2c51e44872b45cc15bf1ac3a72105bdd0e/docs/rules/no-redundant-should-component-update.md
|
||||
// TODO: enable, semver-major
|
||||
'react/no-redundant-should-component-update': 'off',
|
||||
},
|
||||
|
||||
settings: {
|
||||
|
||||
Reference in New Issue
Block a user