Skip to content

Commit 1895b63

Browse files
authored
Merge pull request #40 from infctr/major-deps-update
Prod deps update
2 parents c006219 + f706577 commit 1895b63

File tree

9 files changed

+1134
-953
lines changed

9 files changed

+1134
-953
lines changed

.eslintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ module.exports = {
1111
'plugin:import/errors',
1212
'plugin:import/warnings',
1313
'plugin:import/typescript',
14-
'plugin:@typescript-eslint/eslint-recommended',
1514
'plugin:@typescript-eslint/recommended',
1615
'plugin:eslint-plugin/all',
1716
'plugin:prettier/recommended',
@@ -59,4 +58,5 @@ module.exports = {
5958
},
6059
},
6160
},
61+
ignorePatterns: ['.eslintrc.js'],
6262
}

package.json

Lines changed: 22 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -38,54 +38,51 @@
3838
"test": "yarn jest --watch",
3939
"coverage": "yarn test --coverage --watchAll=false",
4040
"coverage-preview": "http-server -o -p 5000 coverage/lcov-report",
41-
"type-check": "tsc --noEmit --skipLibCheck",
42-
"verify": "yarn type-check && yarn lint && yarn build && yarn coverage"
41+
"typecheck": "tsc --noEmit --skipLibCheck",
42+
"verify": "yarn typecheck && yarn lint && yarn build && yarn coverage"
4343
},
4444
"dependencies": {
45-
"@typescript-eslint/experimental-utils": "^2.32.0",
46-
"json-schema": "^0.2.5",
45+
"@typescript-eslint/experimental-utils": "^4.29.2",
46+
"json-schema": "^0.3.0",
4747
"natural-compare-lite": "^1.4.0"
4848
},
4949
"devDependencies": {
50-
"@babel/cli": "~7.8.4",
51-
"@babel/core": "~7.9.6",
52-
"@babel/preset-env": "~7.9.6",
53-
"@babel/preset-typescript": "~7.9.0",
50+
"@babel/cli": "~7.14.8",
51+
"@babel/core": "~7.15.0",
52+
"@babel/preset-env": "~7.15.0",
53+
"@babel/preset-typescript": "~7.15.0",
5454
"@infctr/eslint-docs": "~0.4.0",
5555
"@rollup/plugin-commonjs": "~12.0.0",
5656
"@rollup/plugin-json": "~4.0.3",
5757
"@rollup/plugin-node-resolve": "~8.0.0",
5858
"@rollup/plugin-typescript": "~4.1.2",
5959
"@types/babel__core": "~7.1.7",
6060
"@types/babel__preset-env": "~7.9.0",
61-
"@types/eslint": "~6.8.1",
62-
"@types/eslint-plugin-prettier": "~3.1.0",
63-
"@types/http-server": "~0.10.0",
61+
"@types/eslint": "~7.28.0",
6462
"@types/jest": "~25.2.3",
6563
"@types/natural-compare-lite": "~1.4.0",
66-
"@types/prettier": "~2.0.0",
67-
"@types/rimraf": "~3.0.0",
68-
"@types/tmp": "~0.2.0",
69-
"@typescript-eslint/eslint-plugin": "~3.5.0",
70-
"@typescript-eslint/parser": "~3.5.0",
64+
"@types/rimraf": "~3.0.1",
65+
"@types/tmp": "~0.2.1",
66+
"@typescript-eslint/eslint-plugin": "~4.29.2",
67+
"@typescript-eslint/parser": "~4.29.2",
7168
"babel-jest": "~26.6.3",
7269
"babel-plugin-module-resolver": "~4.1.0",
73-
"eslint": "~7.23.0",
74-
"eslint-config-prettier": "~8.1.0",
75-
"eslint-plugin-eslint-plugin": "~2.3.0",
76-
"eslint-plugin-import": "~2.22.1",
77-
"eslint-plugin-jest": "~24.3.2",
78-
"eslint-plugin-prettier": "~3.3.1",
79-
"http-server": "~0.12.3",
70+
"eslint": "~7.32.0",
71+
"eslint-config-prettier": "~8.3.0",
72+
"eslint-plugin-eslint-plugin": "~3.5.3",
73+
"eslint-plugin-import": "~2.24.0",
74+
"eslint-plugin-jest": "~24.4.0",
75+
"eslint-plugin-prettier": "~3.4.0",
76+
"http-server": "~13.0.0",
8077
"husky": "~4.2.5",
8178
"jest": "~26.6.3",
8279
"lint-staged": "~10.5.4",
83-
"prettier": "~2.2.1",
80+
"prettier": "~2.3.2",
8481
"rimraf": "~3.0.2",
8582
"rollup": "~2.10.5",
8683
"tmp": "~0.2.1",
8784
"tsconfig": "~7.0.0",
88-
"typescript": "~3.9.3"
85+
"typescript": "~4.3.5"
8986
},
9087
"peerDependencies": {
9188
"@typescript-eslint/parser": "^1 || ^2 || ^3 || ^4",

src/config/recommended.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
export default {
22
plugins: ['typescript-sort-keys'],
33
rules: {
4-
'typescript-sort-keys/interface': 'error',
5-
'typescript-sort-keys/string-enum': 'error',
4+
'typescript-sort-keys/interface': 'error' as const,
5+
'typescript-sort-keys/string-enum': 'error' as const,
66
},
77
}

src/utils/compare.ts

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -51,28 +51,26 @@ const ascendingInsensitiveNatural = (a: string, b: string) => {
5151
/**
5252
* Functions which check that the given 2 names are in specific order.
5353
*/
54-
export const compareFn = (
55-
isAscending: boolean,
56-
isInsensitive: boolean,
57-
isNatural: boolean,
58-
) => (...args: [string?, string?]) => {
59-
if (args.filter(Boolean).length !== 2) {
60-
return 0
61-
}
54+
export const compareFn =
55+
(isAscending: boolean, isInsensitive: boolean, isNatural: boolean) =>
56+
(...args: [string?, string?]) => {
57+
if (args.filter(Boolean).length !== 2) {
58+
return 0
59+
}
6260

63-
const input = (isAscending ? args : args.reverse()) as [string, string]
61+
const input = (isAscending ? args : args.reverse()) as [string, string]
6462

65-
if (isInsensitive && isNatural) {
66-
return ascendingInsensitiveNatural(...input)
67-
}
63+
if (isInsensitive && isNatural) {
64+
return ascendingInsensitiveNatural(...input)
65+
}
6866

69-
if (!isInsensitive && isNatural) {
70-
return ascendingNatural(...input)
71-
}
67+
if (!isInsensitive && isNatural) {
68+
return ascendingNatural(...input)
69+
}
7270

73-
if (isInsensitive && !isNatural) {
74-
return ascendingInsensitive(...input)
75-
}
71+
if (isInsensitive && !isNatural) {
72+
return ascendingInsensitive(...input)
73+
}
7674

77-
return ascending(...input)
78-
}
75+
return ascending(...input)
76+
}

src/utils/plugin.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,10 @@ function createNodeSwapper(context: UtilRuleContext<string, RuleOptions>) {
139139

140140
export function createReporter<MessageIds extends string>(
141141
context: UtilRuleContext<MessageIds, RuleOptions>,
142-
createReportObject: (
143-
node: TSESTree.Node,
144-
) => { readonly loc: TSESTree.SourceLocation; readonly messageId: MessageIds },
142+
createReportObject: (node: TSESTree.Node) => {
143+
readonly loc: TSESTree.SourceLocation
144+
readonly messageId: MessageIds
145+
},
145146
) {
146147
// Parse options.
147148
const order = context.options[0] || SortingOrder.Ascending

tests/autofix.spec.ts

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,13 @@
11
import path from 'path'
22
import fs from 'fs'
33
import tmp from 'tmp'
4-
import { ESLint } from 'eslint'
4+
import { ESLint, Linter } from 'eslint'
55

66
import plugin from '../src'
77
import recommended from 'config/recommended'
8+
import { SortingOrder } from 'common/options'
89
import { typescript } from './helpers/configs'
910

10-
declare module 'eslint' {
11-
export class ESLint {
12-
constructor(config?: any)
13-
14-
lintFiles(path: string | string[]): Promise<any>
15-
static outputFixes(config: any): Promise<void>
16-
}
17-
}
18-
1911
describe('autofix', () => {
2012
beforeEach(() => {
2113
tmp.setGracefulCleanup()
@@ -25,14 +17,14 @@ describe('autofix', () => {
2517
[recommended, 'autofix.output.ts'],
2618
[
2719
{
28-
...recommended,
20+
plugins: recommended.plugins,
2921
rules: {
3022
...recommended.rules,
3123
'typescript-sort-keys/interface': [
32-
'error',
33-
'asc',
24+
'error' as const,
25+
SortingOrder.Ascending,
3426
{ caseSensitive: true, natural: true, requiredFirst: true },
35-
],
27+
] as Linter.RuleEntry,
3628
},
3729
},
3830
'requiredFirst.output.ts',

tests/rules/interface.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1795,7 +1795,7 @@ const invalid: readonly InvalidTestCase<Options>[] = [
17951795
describe('TypeScript', () => {
17961796
const ruleTester = new RuleTester(typescript)
17971797

1798-
ruleTester.run(name, (rule as unknown) as Rule.RuleModule, {
1798+
ruleTester.run(name, rule as unknown as Rule.RuleModule, {
17991799
valid: processValidTestCase(valid),
18001800
invalid: processInvalidTestCase(invalid),
18011801
})

tests/rules/string-enum.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -852,7 +852,7 @@ const invalid: readonly InvalidTestCase<Options>[] = [
852852
describe('TypeScript', () => {
853853
const ruleTester = new RuleTester(typescript)
854854

855-
ruleTester.run(name, (rule as unknown) as Rule.RuleModule, {
855+
ruleTester.run(name, rule as unknown as Rule.RuleModule, {
856856
valid: processValidTestCase(valid),
857857
invalid: processInvalidTestCase(invalid),
858858
})

0 commit comments

Comments
 (0)