Skip to content

Commit

Permalink
refactor: Remove special syntax for a rules turned off
Browse files Browse the repository at this point in the history
As a part of the migration to ESLint 9 and making things more explicit, we decided to drop the special syntax and different configuration variations.
This change does not affect anything in the final config, as the rules are turned off.
  • Loading branch information
MorevM committed Jun 8, 2024
1 parent 08b2caa commit b4af41d
Show file tree
Hide file tree
Showing 14 changed files with 53 additions and 53 deletions.
2 changes: 1 addition & 1 deletion configurations/astro/rules/astro.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ module.exports = {

// Require `class:list` directives instead of `class` with expressions (autofixable)
// https://ota-meshi.github.io/eslint-plugin-astro/rules/prefer-class-list-directive/
'+astro/prefer-class-list-directive': 'off',
'astro/prefer-class-list-directive': 'off',

// Require use object instead of ternary expression in `class:list` (autofixable)
// https://ota-meshi.github.io/eslint-plugin-astro/rules/prefer-object-class-list/
Expand Down
6 changes: 3 additions & 3 deletions configurations/base/plugins/jsdoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ module.exports = {
// Reports the name portion of a JSDoc tag if matching
// or not matching a given regular expression (partly autofixable)
// https://github.com/gajus/eslint-plugin-jsdoc#match-name
'+jsdoc/match-name': 'off',
'jsdoc/match-name': 'off',

// Controls how and whether jsdoc blocks can be expressed
// as single or multiple line blocks (autofixable)
Expand Down Expand Up @@ -122,7 +122,7 @@ module.exports = {

// Prevents use of multiple asterisks at the beginning of lines (autofixable)
// https://github.com/gajus/eslint-plugin-jsdoc#no-multi-asterisks
'+jsdoc/no-multi-asterisks': 'off',
'jsdoc/no-multi-asterisks': 'off',

// Reports when certain comment structures are present
// https://github.com/gajus/eslint-plugin-jsdoc#no-restricted-syntax
Expand Down Expand Up @@ -441,7 +441,7 @@ module.exports = {
// Auto-escape certain characters that are input within block and tag descriptions (autofixable)
// https://github.com/gajus/eslint-plugin-jsdoc/blob/master/README.md#text-escaping
// Note: HTML tags should mostly be enclosed in backticks, and HTML tags display fine inside them.
'+jsdoc/text-escaping': ['off', {
'jsdoc/text-escaping': ['off', {
escapeHTML: true,
escapeMarkdown: false, // For a while, seems nothing wrong with it
}],
Expand Down
4 changes: 2 additions & 2 deletions configurations/base/plugins/regexp.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ module.exports = {

// Disallow exponential and polynomial backtracking (autofixable but too strict)
// https://ota-meshi.github.io/eslint-plugin-regexp/rules/no-super-linear-backtracking.html
'+regexp/no-super-linear-backtracking': ['off', {
'regexp/no-super-linear-backtracking': ['off', {
report: 'certain',
}],

Expand Down Expand Up @@ -374,7 +374,7 @@ module.exports = {

// Enforce use of unicode codepoint escapes (autofixable)
// https://ota-meshi.github.io/eslint-plugin-regexp/rules/prefer-unicode-codepoint-escapes.html
'+regexp/prefer-unicode-codepoint-escapes': 'off',
'regexp/prefer-unicode-codepoint-escapes': 'off',

// Enforce using `\w` (autofixable)
// https://ota-meshi.github.io/eslint-plugin-regexp/rules/prefer-w.html
Expand Down
16 changes: 8 additions & 8 deletions configurations/base/plugins/stylistic.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ module.exports = {

// Enforce line breaks between array elements (autofixable)
// https://eslint.style/rules/js/array-element-newline
'+@stylistic/js/array-element-newline': 'off',
'@stylistic/js/array-element-newline': 'off',

// Require or disallow parentheses around arrow function arguments (autofixable)
// https://eslint.style/rules/js/arrow-parens
// Note: it was an `error`, next it was `warn` but...developer knows better
'+@stylistic/js/arrow-parens': ['off', 'off'],
'@stylistic/js/arrow-parens': ['off', 'off'],

// Enforce spacing before and after the arrow in arrow functions (autofixable)
// https://eslint.style/rules/js/arrow-spacing
Expand Down Expand Up @@ -87,7 +87,7 @@ module.exports = {

// Require or disallow spacing between function identifiers and their invocations (autofixable)
// https://eslint.style/rules/js/func-call-spacing
'+@stylistic/js/func-call-spacing': 'off',
'@stylistic/js/func-call-spacing': 'off',

// Enforce linebreaks between arguments of a function call (autofixable)
// https://eslint.style/rules/js/function-call-argument-newline
Expand Down Expand Up @@ -149,7 +149,7 @@ module.exports = {

// Enforce empty lines around comments (autofixable)
// https://eslint.style/rules/js/lines-around-comment
'+@stylistic/js/lines-around-comment': 'off',
'@stylistic/js/lines-around-comment': 'off',

// Require or disallow an empty line between class members (autofixable)
// https://eslint.style/rules/js/lines-between-class-members
Expand Down Expand Up @@ -185,7 +185,7 @@ module.exports = {
// Require a newline after each call in a method chain (autofixable)
// https://eslint.style/rules/js/newline-per-chained-call
// Note: remain it on developers
'+@stylistic/js/newline-per-chained-call': 'off',
'@stylistic/js/newline-per-chained-call': 'off',

// Disallow arrow functions where they could be confused with comparisons (autofixable)
// https://eslint.style/rules/js/no-confusing-arrow
Expand All @@ -197,7 +197,7 @@ module.exports = {
// Disallow unnecessary parentheses (autofixable)
// https://eslint.style/rules/js/no-extra-parens
// Note: let developer decide which format is better
'+@stylistic/js/no-extra-parens': 'off',
'@stylistic/js/no-extra-parens': 'off',

// Disallow unnecessary semicolons (autofixable)
// https://eslint.style/rules/js/no-extra-semi
Expand Down Expand Up @@ -315,7 +315,7 @@ module.exports = {

// Require or disallow padding lines between statements (autofixable)
// https://eslint.style/rules/js/padding-line-between-statements
'+@stylistic/js/padding-line-between-statements': 'off',
'@stylistic/js/padding-line-between-statements': 'off',

// Require quotes around object literal property names (autofixable)
// https://eslint.style/rules/js/quote-props
Expand Down Expand Up @@ -416,7 +416,7 @@ module.exports = {

// Require parenthesis around regex literals (autofixable)
// https://eslint.style/rules/js/wrap-regex
'+@stylistic/js/wrap-regex': 'off',
'@stylistic/js/wrap-regex': 'off',

// Require or disallow spacing around the `*` in `yield*` expressions (autofixable)
// https://eslint.style/rules/js/yield-star-spacing
Expand Down
24 changes: 12 additions & 12 deletions configurations/base/plugins/unicorn.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module.exports = {
// Enforce a specific parameter name in catch clauses (autofixable)
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/catch-error-name.md
// Note: developer knows better
'+unicorn/catch-error-name': ['off', {
'unicorn/catch-error-name': ['off', {
name: 'error',
ignore: [],
}],
Expand Down Expand Up @@ -51,7 +51,7 @@ module.exports = {

// Enforce explicitly comparing the length or size property of a value
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/explicit-length-check.md
'+unicorn/explicit-length-check': 'off',
'unicorn/explicit-length-check': 'off',

// Enforce a case style for filenames
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/filename-case.md
Expand Down Expand Up @@ -87,7 +87,7 @@ module.exports = {
// Prefer `for…of` over `Array#forEach(…)` (partly autofixable)
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-array-for-each.md
// Note: what's the problem with `forEach`?
'+unicorn/no-array-for-each': 'off',
'unicorn/no-array-for-each': 'off',

// Disallow using the this argument in array methods (partly autofixable)
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-array-method-this-argument.md
Expand Down Expand Up @@ -162,17 +162,17 @@ module.exports = {
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-negated-condition.md
// Note: this is `no-negated-condition` with autofix capacity.
'no-negated-condition': 'off',
'+unicorn/no-negated-condition': 'off',
'unicorn/no-negated-condition': 'off',

// Disallow nested ternary expressions (partly autofixable).
// It allows nested, but they should be wrapped in parentheses (thats correct).
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-nested-ternary.md
'no-nested-ternary': 'off',
'+unicorn/no-nested-ternary': 'off',
'unicorn/no-nested-ternary': 'off',

// Disallow `new Array()` (partly autofixable)
// Note: no need, it's clear if only one parameter as defined in base `no-array-constructor`
'+unicorn/no-new-array': 'off',
'unicorn/no-new-array': 'off',

// Enforce the use of `Buffer.from()` and `Buffer.alloc()` instead of the deprecated `new Buffer()`
// (partly autofixable)
Expand Down Expand Up @@ -227,7 +227,7 @@ module.exports = {
// Disallow unreadable array destructuring (partly autofixable)
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-unreadable-array-destructuring.md
// Note: developer knows better
'+unicorn/no-unreadable-array-destructuring': 'off',
'unicorn/no-unreadable-array-destructuring': 'off',

// Disallow unreadable IIFEs
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-unreadable-iife.md
Expand All @@ -244,7 +244,7 @@ module.exports = {

// Disallow useless array length check (autofixable)
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-useless-length-check.md
'+unicorn/no-useless-length-check': 'off',
'unicorn/no-useless-length-check': 'off',

// Disallow returning/yielding P`romise.resolve/reject()` in async functions or promise callbacks (autofixable)
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-useless-promise-resolve-reject.md
Expand All @@ -261,12 +261,12 @@ module.exports = {
// Disallow useless undefined (autofixable)
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-useless-undefined.md
// Note: as for `null`, developer should know better
'+unicorn/no-useless-undefined': 'off',
'unicorn/no-useless-undefined': 'off',

// Disallow number literals with zero fractions or dangling dots (autofixable)
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-zero-fractions.md
// Note: developer knows better, maybe we want to indicate number which `used as` double next
'+unicorn/no-zero-fractions': 'off',
'unicorn/no-zero-fractions': 'off',

// Enforce proper case for numeric literals (autofixable)
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/number-literal-case.md
Expand Down Expand Up @@ -384,7 +384,7 @@ module.exports = {
// Prefer `Number` static properties over global ones (partly autofixable)
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-number-properties.md
// Note: what's the problem with global functions? I'm serious.
'+unicorn/prefer-number-properties': 'off',
'unicorn/prefer-number-properties': 'off',

// Prefer using `Object.fromEntries(…)` to transform a list of key-value pairs into an object
// (autofixable for simple cases)
Expand All @@ -399,7 +399,7 @@ module.exports = {
// Prefer borrowing methods from the prototype instead of methods from an instance (autofixable)
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-prototype-methods.md
// Reason for `off`: Too verbose, would anyone seriously overwrite methods of global objects?
'+unicorn/prefer-prototype-methods': 'off',
'unicorn/prefer-prototype-methods': 'off',

// Prefer `.querySelector()` over `.getElementById()`,
// `.querySelectorAll()` over `.getElementsByClassName()` and .`getElementsByTagName()`. (partly autofixable)
Expand Down
10 changes: 5 additions & 5 deletions configurations/base/rules/suggestions.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ module.exports = {

// Enforce a particular style for multiline comments (autofixable)
// https://eslint.org/docs/rules/multiline-comment-style
'+multiline-comment-style': 'off',
'multiline-comment-style': 'off',

// Require constructor names to begin with a capital letter
// https://eslint.org/docs/rules/new-cap
Expand Down Expand Up @@ -271,7 +271,7 @@ module.exports = {
// Disallow the type conversion with shorter notations (autofixable)
// https://eslint.org/docs/rules/no-implicit-coercion
// Note: everyone should know about this shorthands
'+no-implicit-coercion': 'off',
'no-implicit-coercion': 'off',

// Disallow declarations in the global scope
// https://eslint.org/docs/rules/no-implicit-globals
Expand Down Expand Up @@ -628,7 +628,7 @@ module.exports = {
// Require or disallow assignment operator shorthand where possible (autofixable)
// https://eslint.org/docs/rules/operator-assignment
// Note: on the conscience of the developer
'+operator-assignment': 'off',
'operator-assignment': 'off',

// Require using arrow functions for callbacks (autofixable)
// https://eslint.org/docs/rules/prefer-arrow-callback
Expand Down Expand Up @@ -726,15 +726,15 @@ module.exports = {
// Enforce sorted import declarations within modules (autofixable)
// https://eslint.org/docs/rules/sort-imports
// Note: developer knows better in common case
'+sort-imports': 'off',
'sort-imports': 'off',

// Require object keys to be sorted
// https://eslint.org/docs/rules/sort-keys
'sort-keys': 'off',

// Require variables within the same declaration block to be sorted (autofixable)
// https://eslint.org/docs/rules/sort-vars
'+sort-vars': 'off',
'sort-vars': 'off',

// Require or disallow `strict` mode directives (autofixable)
// https://eslint.org/docs/rules/strict
Expand Down
2 changes: 1 addition & 1 deletion configurations/html/rules/style.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,6 @@ module.exports = {

// Enforce attributes alphabetical sorting (autofixable)
// https://html-eslint.org/docs/rules/sort-attrs
'+@html-eslint/sort-attrs': 'off',
'@html-eslint/sort-attrs': 'off',
},
};
4 changes: 2 additions & 2 deletions configurations/jest/rules/jest.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,11 +154,11 @@ module.exports = {

// Prefer importing Jest globals (autofixable)
// https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/prefer-importing-jest-globals.md
'+jest/prefer-importing-jest-globals': 'off',
'jest/prefer-importing-jest-globals': 'off',

// Enforce lowercase test names (autofixable)
// https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/prefer-lowercase-title.md
'+jest/prefer-lowercase-title': 'off',
'jest/prefer-lowercase-title': 'off',

// Prefer mock resolved/rejected shorthands for promises (autofixable)
// https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/prefer-mock-promise-shorthand.md
Expand Down
2 changes: 1 addition & 1 deletion configurations/json/rules/json.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ module.exports = {
// Require array values to be sorted (autofixable)
// https://ota-meshi.github.io/eslint-plugin-jsonc/rules/sort-array-values.html
// Note: should be configured individually
'+jsonc/sort-array-values': 'off',
'jsonc/sort-array-values': 'off',

// Disallow invalid number for JSON (autofixable)
// https://ota-meshi.github.io/eslint-plugin-jsonc/rules/valid-json-number.html
Expand Down
12 changes: 6 additions & 6 deletions configurations/typescript/rules/typescript.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ module.exports = {
// Note: `record` is preferred as more readable, but the `index-signature` option
// provides extra information about the key name, that is necessary sometimes.
// In other words, "developer knows better"
'+@typescript-eslint/consistent-indexed-object-style': ['off', 'record'],
'@typescript-eslint/consistent-indexed-object-style': ['off', 'record'],

// Enforces consistent usage of type assertions (autofixable)
// https://typescript-eslint.io/rules/consistent-type-assertions
Expand All @@ -161,7 +161,7 @@ module.exports = {
// Consistent with type definition either interface or type (autofixable)
// https://typescript-eslint.io/rules/consistent-type-definitions
// Note: I believe it's really debatable on a holywar level
'+@typescript-eslint/consistent-type-definitions': 'off',
'@typescript-eslint/consistent-type-definitions': 'off',

// Enforces consistent usage of type exports (autofixable) (SETTINGS)
// https://typescript-eslint.io/rules/consistent-type-exports
Expand Down Expand Up @@ -309,7 +309,7 @@ module.exports = {

// Requires expressions of type void to appear in statement position (autofixable)
// https://typescript-eslint.io/rules/no-confusing-void-expression
'+@typescript-eslint/no-confusing-void-expression': ['off', {
'@typescript-eslint/no-confusing-void-expression': ['off', {
ignoreArrowShorthand: true,
ignoreVoidOperator: false,
}],
Expand Down Expand Up @@ -503,7 +503,7 @@ module.exports = {

// Prevents conditionals where the type is always truthy or always falsy (autofixable)
// https://typescript-eslint.io/rules/no-unnecessary-condition
'+@typescript-eslint/no-unnecessary-condition': 'off',
'@typescript-eslint/no-unnecessary-condition': 'off',

// Warns when a namespace qualifier is unnecessary (autofixable)
// https://typescript-eslint.io/rules/no-unnecessary-qualifier
Expand All @@ -512,7 +512,7 @@ module.exports = {
// Enforces that type arguments will not be used if not required (autofixable)
// https://typescript-eslint.io/rules/no-unnecessary-type-arguments
// Note: explicit better than implicit
'+@typescript-eslint/no-unnecessary-type-arguments': 'off',
'@typescript-eslint/no-unnecessary-type-arguments': 'off',

// Warns if a type assertion does not change the type of an expression (autofixable)
// https://typescript-eslint.io/rules/no-unnecessary-type-assertion
Expand Down Expand Up @@ -681,7 +681,7 @@ module.exports = {
// Enforce that `RegExp#exec` is used instead of `String#match` if no global flag is provided (autofixable)
// https://typescript-eslint.io/rules/prefer-regexp-exec
// Note: String#match more readable
'+@typescript-eslint/prefer-regexp-exec': 'off',
'@typescript-eslint/prefer-regexp-exec': 'off',

// Enforce that `this` is used when only `this` type is returned (autofixable)
// https://typescript-eslint.io/rules/prefer-return-this-type
Expand Down
8 changes: 4 additions & 4 deletions configurations/vitest/rules/vitest.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ module.exports = {

// Enforce lowercase titles (autofixable)
// https://github.com/veritem/eslint-plugin-vitest/blob/main/docs/rules/prefer-lowercase-title.md
'+vitest/prefer-lowercase-title': 'off',
'vitest/prefer-lowercase-title': 'off',

// Prefer mock resolved/rejected shorthands for promises (autofixable)
// https://github.com/veritem/eslint-plugin-vitest/blob/main/docs/rules/prefer-mock-promise-shorthand.md
Expand All @@ -166,15 +166,15 @@ module.exports = {

// Suggest using `toBeFalsy()` (autofixable)
// https://github.com/veritem/eslint-plugin-vitest/blob/main/docs/rules/prefer-to-be-falsy.md
'+vitest/prefer-to-be-falsy': 'off',
'vitest/prefer-to-be-falsy': 'off',

// Suggest using `toBeObject()` (autofixable)
// https://github.com/veritem/eslint-plugin-vitest/blob/main/docs/rules/prefer-to-be-object.md
'+vitest/prefer-to-be-object': 'off',
'vitest/prefer-to-be-object': 'off',

// Suggest using `toBeTruthy()` (autofixable)
// https://github.com/veritem/eslint-plugin-vitest/blob/main/docs/rules/prefer-to-be-object.md
'+vitest/prefer-to-be-truthy': 'off',
'vitest/prefer-to-be-truthy': 'off',

// Suggest using `toContain()` (autofixable)
// https://github.com/veritem/eslint-plugin-vitest/blob/main/docs/rules/prefer-to-be-truthy.md
Expand Down
2 changes: 1 addition & 1 deletion configurations/vue/rules/strongly-recommended.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ module.exports = {
// Require a line break before and after the contents of a singleline element (autofixable)
// https://eslint.vuejs.org/rules/singleline-html-element-content-newline.html
// Note: let developer decide which variant will be more readable
'+vue/singleline-html-element-content-newline': 'off',
'vue/singleline-html-element-content-newline': 'off',

// Enforce `v-bind` directive style (autofixable)
// https://eslint.vuejs.org/rules/v-bind-style.html
Expand Down
Loading

0 comments on commit b4af41d

Please sign in to comment.