Skip to content

Commit

Permalink
chore(deps): update typescript-eslint monorepo to v6
Browse files Browse the repository at this point in the history
  • Loading branch information
renovate[bot] authored and quentinderoubaix committed Aug 25, 2023
1 parent 12c4477 commit 9908407
Show file tree
Hide file tree
Showing 18 changed files with 573 additions and 75 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ test-results/
.svelte-kit/
demo/vite-env.d.ts
demo/src/app.d.ts
**/environment.prod.ts
1 change: 0 additions & 1 deletion angular/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
"declaration": false,
"downlevelIteration": true,
"experimentalDecorators": true,
"moduleResolution": "node",
"importHelpers": true,
"target": "ES2022",
"module": "es2020",
Expand Down
1 change: 0 additions & 1 deletion demo/src/lib/stackblitz/angular/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"skipLibCheck": true,
"esModuleInterop": true,
"resolveJsonModule": true,
"moduleResolution": "node",
"isolatedModules": true,
"forceConsistentCasingInFileNames": true
}
Expand Down
1 change: 0 additions & 1 deletion demo/src/lib/stackblitz/react/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"skipLibCheck": true,
"esModuleInterop": true,
"resolveJsonModule": true,
"moduleResolution": "node",
"isolatedModules": true,
"forceConsistentCasingInFileNames": true,
"noEmit": true
Expand Down
1 change: 0 additions & 1 deletion demo/src/lib/stackblitz/svelte/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
"skipLibCheck": true,
"esModuleInterop": true,
"resolveJsonModule": true,
"moduleResolution": "node",
"isolatedModules": true,
"forceConsistentCasingInFileNames": true
}
Expand Down
1 change: 0 additions & 1 deletion demo/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"skipLibCheck": true,
"esModuleInterop": true,
"resolveJsonModule": true,
"moduleResolution": "node",
"importsNotUsedAsValues": "error",
"isolatedModules": true,
"forceConsistentCasingInFileNames": true,
Expand Down
3 changes: 2 additions & 1 deletion eslint-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@
"private": true,
"main": "dist/index.js",
"dependencies": {
"@typescript-eslint/utils": "^5.62.0"
"@typescript-eslint/utils": "^6.4.1"
},
"peerDependencies": {
"typescript": "*"
},
"devDependencies": {
"@angular/core": "^16.2.2",
"@typescript-eslint/rule-tester": "^6.4.1",
"svelte": "^4.2.0",
"svelte-eslint-parser": "^0.33.0"
},
Expand Down
2 changes: 1 addition & 1 deletion eslint-plugin/src/angular-check-props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ export const angularCheckPropsRule = ESLintUtils.RuleCreator.withoutDocs({
meta: {
docs: {
description: 'Check AgnosUI props in angular components.',
recommended: 'error',
recommended: 'recommended',
},
fixable: 'code',
messages: {
Expand Down
2 changes: 1 addition & 1 deletion eslint-plugin/src/svelte-check-props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ export const svelteCheckPropsRule = ESLintUtils.RuleCreator.withoutDocs({
meta: {
docs: {
description: 'Check AgnosUI props in svelte components.',
recommended: 'error',
recommended: 'recommended',
},
fixable: 'code',
messages: {
Expand Down
2 changes: 1 addition & 1 deletion eslint-plugin/src/svelte-check-slots.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ export const svelteCheckSlotsRule = ESLintUtils.RuleCreator.withoutDocs({
meta: {
docs: {
description: 'Check AgnosUI calls to Slot in svelte components.',
recommended: 'error',
recommended: 'recommended',
},
fixable: 'code',
messages: {
Expand Down
13 changes: 8 additions & 5 deletions eslint-plugin/test/angular-check-props.spec.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,25 @@
import {test} from 'vitest';
import {afterAll, test} from 'vitest';
import {angularCheckPropsRule} from '../src/angular-check-props';
import type {TSESLint} from '@typescript-eslint/utils';
import {ESLintUtils} from '@typescript-eslint/utils';
import type {InvalidTestCase} from '@typescript-eslint/rule-tester';
import {RuleTester} from '@typescript-eslint/rule-tester';

RuleTester.afterAll = afterAll;

test('angular-check-props', () => {
const codeTemplate = (classContent: string, widgetProps: string, classContent2 = '') =>
`import { Component, EventEmitter } from "@angular/core";\ninterface MyWidgetProps {\n${widgetProps}\n}\ninterface MyWidget {\n\tpatch(props: Partial<MyWidgetProps>): void\n}\n@Component({})\nclass MyComponent {\n${classContent}\n\t_widget: MyWidget;\n${classContent2}\n}`;

const ruleTester = new ESLintUtils.RuleTester({
parser: '@typescript-eslint/parser',
const ruleTester = new RuleTester({
parser: require.resolve('@typescript-eslint/parser'),
parserOptions: {
project: './tsconfig.test.json',
tsconfigRootDir: __dirname,
},
});
type MessageIds<T extends TSESLint.RuleModule<any, any>> = T extends TSESLint.RuleModule<infer U, any> ? U : never;

const invalid: ESLintUtils.InvalidTestCase<MessageIds<typeof angularCheckPropsRule>, []>[] = [
const invalid: InvalidTestCase<MessageIds<typeof angularCheckPropsRule>, []>[] = [
{
code: codeTemplate('@Input() someInput;', ''),
errors: [{messageId: 'extraProp', data: {type: 'input', name: 'someInput'}}],
Expand Down
13 changes: 8 additions & 5 deletions eslint-plugin/test/svelte-check-props.spec.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
import {test} from 'vitest';
import {afterAll, test} from 'vitest';
import {svelteCheckPropsRule} from '../src/svelte-check-props';
import type {TSESLint} from '@typescript-eslint/utils';
import {ESLintUtils} from '@typescript-eslint/utils';
import type {InvalidTestCase} from '@typescript-eslint/rule-tester';
import {RuleTester} from '@typescript-eslint/rule-tester';

RuleTester.afterAll = afterAll;

test('svelte-check-props', () => {
const codeTemplate = (scriptContent: string, widgetProps: string, scriptContent2 = '') =>
`<script lang="ts" context="module">\nimport { createEventDispatcher } from "svelte";\ninterface MyWidgetProps {\n${widgetProps}\n}\ninterface MyWidget {\n\tpatch(props: Partial<MyWidgetProps>): void\n}\n</script><script lang="ts">\nconst dispatch = createEventDispatcher();\n${scriptContent}\nlet widget: MyWidget;\n${scriptContent2}\n</script>`;

const ruleTester = new ESLintUtils.RuleTester({
const ruleTester = new RuleTester({
plugins: ['svelte'],
parser: require.resolve('svelte-eslint-parser') as any,
parser: require.resolve('svelte-eslint-parser'),
parserOptions: {
parser: '@typescript-eslint/parser',
project: './tsconfig.test.json',
Expand All @@ -19,7 +22,7 @@ test('svelte-check-props', () => {
});
type MessageIds<T extends TSESLint.RuleModule<any, any>> = T extends TSESLint.RuleModule<infer U, any> ? U : never;

const invalid: ESLintUtils.InvalidTestCase<MessageIds<typeof svelteCheckPropsRule>, []>[] = [
const invalid: InvalidTestCase<MessageIds<typeof svelteCheckPropsRule>, []>[] = [
{
filename: 'file.svelte',
code: codeTemplate('export let someProp: string | undefined;', ''),
Expand Down
5 changes: 4 additions & 1 deletion eslint-plugin/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
{
"extends": "../tsconfig.json"
"extends": "../tsconfig.json",
"compilerOptions": {
"moduleResolution": "bundler"
}
}
1 change: 1 addition & 0 deletions eslint-plugin/vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ export default defineConfig({
coverage: {
reporter: ['text', 'json', 'html'],
},
globals: true,
},
});
Loading

0 comments on commit 9908407

Please sign in to comment.