Skip to content

Commit

Permalink
feat: move to typescript-eslint v6
Browse files Browse the repository at this point in the history
  • Loading branch information
azat-io committed Jul 16, 2023
1 parent 3f8fffa commit cc60682
Show file tree
Hide file tree
Showing 28 changed files with 303 additions and 120 deletions.
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@
"eslint": ">=8.0.0"
},
"dependencies": {
"@typescript-eslint/types": "^5.62.0",
"@typescript-eslint/utils": "^5.62.0",
"@typescript-eslint/types": "^6.0.0",
"@typescript-eslint/utils": "^6.0.0",
"is-core-module": "^2.12.1",
"json5": "^2.2.3",
"minimatch": "^9.0.3",
Expand All @@ -69,8 +69,9 @@
"@types/is-core-module": "^2.2.0",
"@types/natural-compare-lite": "^1.4.0",
"@types/node": "^20.4.2",
"@typescript-eslint/eslint-plugin": "^5.62.0",
"@typescript-eslint/parser": "^5.62.0",
"@typescript-eslint/eslint-plugin": "^6.0.0",
"@typescript-eslint/parser": "^6.0.0",
"@typescript-eslint/rule-tester": "^6.0.0",
"@vitest/coverage-v8": "^0.33.0",
"changelogen": "^0.5.4",
"clean-publish": "^4.2.0",
Expand Down
218 changes: 160 additions & 58 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion rules/sort-array-includes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ export default createEslintRule<Options, MESSAGE_ID>({
type: 'suggestion',
docs: {
description: 'enforce sorted arrays before include method',
recommended: false,
},
fixable: 'code',
schema: [
Expand All @@ -47,10 +46,12 @@ export default createEslintRule<Options, MESSAGE_ID>({
SortType['line-length'],
],
default: SortType.natural,
type: 'string',
},
order: {
enum: [SortOrder.asc, SortOrder.desc],
default: SortOrder.asc,
type: 'string',
},
'ignore-case': {
type: 'boolean',
Expand Down
18 changes: 16 additions & 2 deletions rules/sort-classes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ export default createEslintRule<Options, MESSAGE_ID>({
type: 'suggestion',
docs: {
description: 'enforce sorted classes',
recommended: false,
},
fixable: 'code',
schema: [
Expand All @@ -59,6 +58,7 @@ export default createEslintRule<Options, MESSAGE_ID>({
SortType['line-length'],
],
default: SortType.natural,
type: 'string',
},
'ignore-case': {
type: 'boolean',
Expand All @@ -67,10 +67,24 @@ export default createEslintRule<Options, MESSAGE_ID>({
order: {
enum: [SortOrder.asc, SortOrder.desc],
default: SortOrder.asc,
type: 'string',
},
groups: {
items: {
type: 'string',
enum: [
'private-property',
'static-property',
'private-method',
'static-method',
'constructor',
'property',
'unknown',
'method',
],
},
uniqueItems: true,
type: 'array',
default: ['property', 'constructor', 'method', 'unknown'],
},
},
additionalProperties: false,
Expand Down
3 changes: 2 additions & 1 deletion rules/sort-enums.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ export default createEslintRule<Options, MESSAGE_ID>({
type: 'suggestion',
docs: {
description: 'enforce sorted TypeScript enums',
recommended: false,
},
fixable: 'code',
schema: [
Expand All @@ -44,6 +43,7 @@ export default createEslintRule<Options, MESSAGE_ID>({
SortType['line-length'],
],
default: SortType.natural,
type: 'string',
},
'ignore-case': {
type: 'boolean',
Expand All @@ -52,6 +52,7 @@ export default createEslintRule<Options, MESSAGE_ID>({
order: {
enum: [SortOrder.asc, SortOrder.desc],
default: SortOrder.asc,
type: 'string',
},
},
additionalProperties: false,
Expand Down
3 changes: 2 additions & 1 deletion rules/sort-exports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ export default createEslintRule<Options, MESSAGE_ID>({
type: 'suggestion',
docs: {
description: 'enforce sorted exports',
recommended: false,
},
fixable: 'code',
schema: [
Expand All @@ -45,10 +44,12 @@ export default createEslintRule<Options, MESSAGE_ID>({
SortType['line-length'],
],
default: SortType.natural,
type: 'string',
},
order: {
enum: [SortOrder.asc, SortOrder.desc],
default: SortOrder.asc,
type: 'string',
},
'ignore-case': {
type: 'boolean',
Expand Down
13 changes: 10 additions & 3 deletions rules/sort-imports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ export default createEslintRule<Options<string[]>, MESSAGE_ID>({
type: 'suggestion',
docs: {
description: 'enforce sorted imports',
recommended: false,
},
fixable: 'code',
schema: [
Expand All @@ -107,22 +106,29 @@ export default createEslintRule<Options<string[]>, MESSAGE_ID>({
SortType['line-length'],
],
default: SortType.natural,
type: 'string',
},
order: {
enum: [SortOrder.asc, SortOrder.desc],
default: SortOrder.asc,
type: 'string',
},
'ignore-case': {
type: 'boolean',
default: false,
},
groups: {
items: {
type: 'string',
},
uniqueItems: true,
type: 'array',
default: [],
},
'internal-pattern': {
items: {
type: 'string',
},
type: 'array',
default: ['~/**'],
},
'newlines-between': {
enum: [
Expand All @@ -131,6 +137,7 @@ export default createEslintRule<Options<string[]>, MESSAGE_ID>({
NewlinesBetweenValue.never,
],
default: NewlinesBetweenValue.always,
type: 'string',
},
'read-tsconfig': {
type: 'boolean',
Expand Down
7 changes: 5 additions & 2 deletions rules/sort-interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ export default createEslintRule<Options, MESSAGE_ID>({
type: 'suggestion',
docs: {
description: 'enforce sorted interface properties',
recommended: false,
},
fixable: 'code',
schema: [
Expand All @@ -46,18 +45,22 @@ export default createEslintRule<Options, MESSAGE_ID>({
SortType['line-length'],
],
default: SortType.natural,
type: 'string',
},
order: {
enum: [SortOrder.asc, SortOrder.desc],
default: SortOrder.asc,
type: 'string',
},
'ignore-case': {
type: 'boolean',
default: false,
},
'ignore-pattern': {
items: {
type: 'string',
},
type: 'array',
default: [],
},
},
additionalProperties: false,
Expand Down
10 changes: 8 additions & 2 deletions rules/sort-jsx-props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ export default createEslintRule<Options, MESSAGE_ID>({
type: 'suggestion',
docs: {
description: 'enforce sorted JSX props',
recommended: false,
},
fixable: 'code',
schema: [
Expand All @@ -59,27 +58,34 @@ export default createEslintRule<Options, MESSAGE_ID>({
SortType['line-length'],
],
default: SortType.natural,
type: 'string',
},
order: {
enum: [SortOrder.asc, SortOrder.desc],
default: SortOrder.asc,
type: 'string',
},
'always-on-top': {
items: {
type: 'string',
},
type: 'array',
default: [],
},
'ignore-case': {
type: 'boolean',
default: false,
},
shorthand: {
enum: [Position.first, Position.last, Position.ignore],
type: 'string',
},
callback: {
enum: [Position.first, Position.last, Position.ignore],
type: 'string',
},
multiline: {
enum: [Position.first, Position.last, Position.ignore],
type: 'string',
},
},
additionalProperties: false,
Expand Down
3 changes: 2 additions & 1 deletion rules/sort-map-elements.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ export default createEslintRule<Options, MESSAGE_ID>({
type: 'suggestion',
docs: {
description: 'enforce sorted Map elements',
recommended: false,
},
fixable: 'code',
schema: [
Expand All @@ -46,10 +45,12 @@ export default createEslintRule<Options, MESSAGE_ID>({
SortType['line-length'],
],
default: SortType.natural,
type: 'string',
},
order: {
enum: [SortOrder.asc, SortOrder.desc],
default: SortOrder.asc,
type: 'string',
},
'ignore-case': {
type: 'boolean',
Expand Down
3 changes: 2 additions & 1 deletion rules/sort-named-exports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ export default createEslintRule<Options, MESSAGE_ID>({
type: 'suggestion',
docs: {
description: 'enforce sorted named exports',
recommended: false,
},
fixable: 'code',
schema: [
Expand All @@ -41,10 +40,12 @@ export default createEslintRule<Options, MESSAGE_ID>({
SortType['line-length'],
],
default: SortType.natural,
type: 'string',
},
order: {
enum: [SortOrder.asc, SortOrder.desc],
default: SortOrder.asc,
type: 'string',
},
'ignore-case': {
type: 'boolean',
Expand Down
3 changes: 2 additions & 1 deletion rules/sort-named-imports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ export default createEslintRule<Options, MESSAGE_ID>({
type: 'suggestion',
docs: {
description: 'enforce sorted named imports',
recommended: false,
},
fixable: 'code',
schema: [
Expand All @@ -43,10 +42,12 @@ export default createEslintRule<Options, MESSAGE_ID>({
SortType['line-length'],
],
default: SortType.natural,
type: 'string',
},
order: {
enum: [SortOrder.asc, SortOrder.desc],
default: SortOrder.asc,
type: 'string',
},
'ignore-case': {
type: 'boolean',
Expand Down
3 changes: 2 additions & 1 deletion rules/sort-object-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ export default createEslintRule<Options, MESSAGE_ID>({
type: 'suggestion',
docs: {
description: 'enforce sorted object types',
recommended: false,
},
fixable: 'code',
schema: [
Expand All @@ -44,10 +43,12 @@ export default createEslintRule<Options, MESSAGE_ID>({
SortType['line-length'],
],
default: SortType.natural,
type: 'string',
},
order: {
enum: [SortOrder.asc, SortOrder.desc],
default: SortOrder.asc,
type: 'string',
},
'ignore-case': {
type: 'boolean',
Expand Down
7 changes: 5 additions & 2 deletions rules/sort-objects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ export default createEslintRule<Options, MESSAGE_ID>({
type: 'suggestion',
docs: {
description: 'enforce sorted objects',
recommended: false,
},
fixable: 'code',
schema: [
Expand All @@ -65,18 +64,22 @@ export default createEslintRule<Options, MESSAGE_ID>({
SortType['line-length'],
],
default: SortType.natural,
type: 'string',
},
order: {
enum: [SortOrder.asc, SortOrder.desc],
default: SortOrder.asc,
type: 'string',
},
'ignore-case': {
type: 'boolean',
default: false,
},
'always-on-top': {
items: {
type: 'string',
},
type: 'array',
default: [],
},
},
additionalProperties: false,
Expand Down
3 changes: 2 additions & 1 deletion rules/sort-union-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ export default createEslintRule<Options, MESSAGE_ID>({
type: 'suggestion',
docs: {
description: 'enforce sorted union types',
recommended: false,
},
fixable: 'code',
schema: [
Expand All @@ -42,10 +41,12 @@ export default createEslintRule<Options, MESSAGE_ID>({
SortType['line-length'],
],
default: SortType.natural,
type: 'string',
},
order: {
enum: [SortOrder.asc, SortOrder.desc],
default: SortOrder.asc,
type: 'string',
},
'ignore-case': {
type: 'boolean',
Expand Down
Loading

0 comments on commit cc60682

Please sign in to comment.