Skip to content

Commit

Permalink
chore(eslint-plugin): remove redundant recommended property
Browse files Browse the repository at this point in the history
  • Loading branch information
mainframev committed Oct 18, 2024
1 parent 66a2683 commit 23df010
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 29 deletions.
7 changes: 2 additions & 5 deletions packages/eslint-plugin/src/rules/ban-context-export/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ const { getTypeServices } = require('../../utils/type-services');

/** @typedef { import('@typescript-eslint/utils').TSESTree.VariableDeclarator } VariableDeclarator*/
/** @typedef { import('@typescript-eslint/utils').TSESTree.ExportSpecifier} ExportSpecifier */
/** @typedef { import('@typescript-eslint/utils').TSESLint.RuleMetaDataDocs} RuleMetaDataDocs*/
/** @typedef { import('@typescript-eslint/utils').TSESLint.RuleRecommendation} RuleRecommendation */
/**
* @typedef {{
* exclude?: string[];
Expand All @@ -35,10 +33,9 @@ module.exports = createRule({
},
],
type: 'problem',
docs: /** @type {RuleMetaDataDocs & { recommended: RuleRecommendation }} */ ({
docs: {
description: 'Ban export of React context or context selector objects',
recommended: 'recommended',
}),
},
messages: {
nativeContext: '{{exportName}} should not be exported directly',
contextSelector: '{{exportName}} should not be exported directly',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,15 @@ const createRule = require('../../utils/createRule');

/**
* @typedef {import('./types').HTMLElementConstructorName} HTMLElementConstructorName
* @typedef { import('@typescript-eslint/utils').TSESLint.RuleMetaDataDocs} RuleMetaDataDocs
* @typedef { import('@typescript-eslint/utils').TSESLint.RuleRecommendation} RuleRecommendation
*/

module.exports = createRule({
name: 'ban-instanceof-html-element',
meta: {
type: 'problem',
docs: /** @type {RuleMetaDataDocs & { recommended: RuleRecommendation }} */ ({
docs: {
description: 'Ban usage of instanceof HTMLElement comparison',
recommended: 'recommended',
}),
},
messages: {
invalidBinaryExpression: 'instanceof {{right}} should be avoided, use isHTMLElement instead.',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,14 @@ const { ESLintUtils } = require('@typescript-eslint/utils');

/**
* @typedef { import('@typescript-eslint/utils').TSESLint.RuleMetaDataDocs} RuleMetaDataDocs
* @typedef { import('@typescript-eslint/utils').TSESLint.RuleRecommendation} RuleRecommendation
*/

module.exports = createRule({
name: 'deprecated-keyboard-event-props',
meta: {
type: 'problem',
docs: /** @type {RuleMetaDataDocs & { recommended: RuleRecommendation }} */ ({
docs: /** @type {RuleMetaDataDocs} */ ({
description: 'Forbid use of deprecated KeyboardEvent props "which" and "keyCode".',
recommended: 'recommended',
requiresTypeChecking: true,
}),
messages: {
Expand Down
10 changes: 2 additions & 8 deletions packages/eslint-plugin/src/rules/no-global-react.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,13 @@
const { AST_NODE_TYPES } = require('@typescript-eslint/utils');
const createRule = require('../utils/createRule');

/**
* @typedef { import('@typescript-eslint/utils').TSESLint.RuleMetaDataDocs} RuleMetaDataDocs
* @typedef { import('@typescript-eslint/utils').TSESLint.RuleRecommendation} RuleRecommendation
*/

module.exports = createRule({
name: 'no-global-react',
meta: {
type: 'problem',
docs: /** @type {RuleMetaDataDocs & { recommended: RuleRecommendation }} */ ({
docs: {
description: 'Prevent accidental references to the global React namespace',
recommended: 'recommended',
}),
},
messages: {
missingImport: 'You must explicitly import React to reference it',
},
Expand Down
10 changes: 2 additions & 8 deletions packages/eslint-plugin/src/rules/no-tslint-comments.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,13 @@
// @ts-check
const createRule = require('../utils/createRule');

/**
* @typedef { import('@typescript-eslint/utils').TSESLint.RuleMetaDataDocs} RuleMetaDataDocs
* @typedef { import('@typescript-eslint/utils').TSESLint.RuleRecommendation} RuleRecommendation
*/

module.exports = createRule({
name: 'no-tslint-comments',
meta: {
type: 'problem',
docs: /** @type {RuleMetaDataDocs & { recommended: RuleRecommendation }} */ ({
docs: {
description: 'Forbid tslint:disable/tslint:enable comments after ESLint migration.',
recommended: 'recommended',
}),
},
messages: {
tslint: 'tslint:{{verb}} comments are unnecessary with ESLint',
},
Expand Down

0 comments on commit 23df010

Please sign in to comment.