Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
7992126
chore(deps): upgrade ESLint 8 → 10 with flat config migration
kopernic-pl Jul 31, 2026
103f655
chore(repo): fix prettier formatting in docs/reference
kopernic-pl Jul 31, 2026
ae03bed
fix(ruleset-migrator): update prettier v2 → v3 API usage in tests
kopernic-pl Jul 31, 2026
58b8738
chore(deps): update yarn.lock for ruleset-migrator prettier ^3.0.0
kopernic-pl Jul 31, 2026
e32ffa0
chore(deps): update ruleset-bundler prettier to ^3.0.0
kopernic-pl Jul 31, 2026
0d2f68c
Potential fix for pull request finding
kopernic-pl Jul 31, 2026
8d36dce
fix(core): replace unsound AggregateError cast with runtime narrowing…
kopernic-pl Jul 31, 2026
4e96e81
fix(repo): restore languageOptions wrapper in eslint.config.mjs lost …
kopernic-pl Jul 31, 2026
f76b0af
fix(repo): use fileURLToPath for tsconfigRootDir in eslint.config.mjs
kopernic-pl Jul 31, 2026
e13dfa9
refactor(formatters,cli): replace eslint-disable with Number() coerci…
kopernic-pl Jul 31, 2026
f01c4ea
chore: merge develop into chore/eslint-10-upgrade; resolve yarn.lock …
Copilot Aug 4, 2026
45590ec
Merge branch 'develop' into chore/eslint-10-upgrade
kopernic-pl Aug 4, 2026
1c98e5a
chore(formatters): update ESLint rules and remove unnecessary ignores
kopernic-pl Aug 5, 2026
01de796
Merge branch 'develop' into chore/eslint-10-upgrade
kopernic-pl Aug 5, 2026
ca27542
chore(repo): add no-non-null-assertion rule with warning level so tha…
kopernic-pl Aug 5, 2026
3c053b9
Merge remote-tracking branch 'origin/chore/eslint-10-upgrade' into ch…
kopernic-pl Aug 5, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
117 changes: 0 additions & 117 deletions .eslintrc

This file was deleted.

1 change: 0 additions & 1 deletion .eslintignore → .prettierignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
**/__fixtures__/**
/test-harness/tests/
/packages/*/dist
/packages/rulesets/src/oas/schemas/validators.ts
/packages/rulesets/src/arazzo/schemas/validators.ts
Expand Down
3 changes: 3 additions & 0 deletions docs/reference/asyncapi-rules.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ info:
title: Descriptive API
description: >+
Some description about the general point of this API, and why it exists when another similar but different API also exists.

```

### asyncapi-info-license-url
Expand Down Expand Up @@ -580,6 +581,7 @@ tags:
- name: Invoice Items
description: |+
Giant long explanation about what this business concept is, because other people _might_ not have a clue!

```

**Recommended:** No
Expand Down Expand Up @@ -792,6 +794,7 @@ info:
- name: Invoice Items
description: |+
Giant long explanation about what this business concept is, because other people _might_ not have a clue!

```

**Recommended:** No
Expand Down
2 changes: 2 additions & 0 deletions docs/reference/openapi-rules.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ info:
title: Descriptive API
description: >+
Some description about the general point of this API, and why it exists when another similar but different API also exists.## AuthenticationThis API uses OAuth2 and tokens can be requested from [Dev Portal: Tokens](https://example.org/developers/tokens).

```

### info-license
Expand Down Expand Up @@ -406,6 +407,7 @@ tags:
- name: Invoice Items
description: |+
Giant long explanation about what this business concept is, because other people _might_ not have a clue!

```

**Recommended:** No
Expand Down
118 changes: 118 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
import tseslint from 'typescript-eslint';
import prettierConfig from 'eslint-plugin-prettier/recommended';
import importPlugin from 'eslint-plugin-import-x';
import globals from 'globals';
import { fileURLToPath } from 'node:url';

export default tseslint.config(
// Global ignores (replaces .eslintignore)
{
ignores: [
'**/__fixtures__/**',
'packages/*/dist/**',
'packages/rulesets/src/oas/schemas/validators.ts',
'packages/rulesets/src/arazzo/schemas/validators.ts',
'packages/*/CHANGELOG.md',
'packages/formatters/src/html/templates.ts',
],
},

// Base for all linted files
{
files: ['packages/**/*.{js,mjs,ts}', 'test-harness/**/*.{js,mjs,ts}'],
extends: [tseslint.configs.recommended, prettierConfig],
languageOptions: {
globals: { ...globals.es2015, ...globals.browser, ...globals.node },
},
rules: {
'no-console': 'error',
'no-control-regex': 'error',
'no-shadow-restricted-names': 'error',
'@typescript-eslint/prefer-for-of': 'error',
'@typescript-eslint/no-unused-vars': [
'error',
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
args: 'after-used',
ignoreRestSiblings: true,
},
],
'@typescript-eslint/no-require-imports': 'warn',
'@typescript-eslint/explicit-function-return-type': 'warn',
},
},

// TypeScript source files with type-checking
{
files: ['packages/*/src/**/*.ts'],
extends: [tseslint.configs.eslintRecommended, tseslint.configs.recommendedTypeChecked],
plugins: { import: importPlugin },
languageOptions: {
parserOptions: {
project: './tsconfig.eslint.json',
tsconfigRootDir: fileURLToPath(new URL('.', import.meta.url)),
},
},
rules: {
'@typescript-eslint/prefer-optional-chain': 'error',
'@typescript-eslint/prefer-regexp-exec': 'error',
'@typescript-eslint/prefer-nullish-coalescing': 'error',
'@typescript-eslint/no-floating-promises': ['error', { ignoreVoid: true }],
'@typescript-eslint/strict-boolean-expressions': 'warn',
'@typescript-eslint/only-throw-error': 'error',
'@typescript-eslint/no-unsafe-argument': 'warn',
'@typescript-eslint/no-non-null-assertion': 'warn',
'@typescript-eslint/no-empty-function': 'error',
'import/no-extraneous-dependencies': [
'error',
{ devDependencies: ['**/*.{test,spec}.ts', '**/__tests__/__helpers__/*.ts'] },
],
},
},

// CLI package: downgrade no-console to warn
{
files: ['packages/cli/src/**/*.ts'],
rules: { 'no-console': 'warn' },
},

// Test files: relax strict rules
{
files: ['packages/*/src/**/__tests__/**/*.ts', 'test-harness/**/*.{ts,js}'],
rules: {
'@typescript-eslint/strict-boolean-expressions': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
Comment thread
kopernic-pl marked this conversation as resolved.
'@typescript-eslint/no-floating-promises': 'off',
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/require-await': 'off',
'@typescript-eslint/unbound-method': 'off',
'@typescript-eslint/no-require-imports': 'off',
'@typescript-eslint/prefer-promise-reject-errors': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/restrict-template-expressions': 'off',
},
},

// Jest test files: jest + node globals
{
files: ['**/__tests__/**/*.jest.test.{ts,js}', '__mocks__/**/*.{ts,js}'],
languageOptions: { globals: { ...globals.jest, ...globals.node } },
},

// Karma test files: browser + jasmine globals
{
files: ['**/__tests__/**/*.karma.test.{ts,js}'],
languageOptions: { globals: { ...globals.browser, ...globals.jasmine } },
},

// Scripts and test-harness: node globals
{
files: ['scripts/**/*.{mjs,ts}', 'test-harness/**/*.{ts,js}'],
languageOptions: { globals: { ...globals.node } },
},
);
28 changes: 15 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
"prelint": "yarn workspaces foreach run prelint",
"lint": "yarn prelint && yarn lint.prettier && yarn lint.eslint",
"lint.fix": "yarn lint.prettier --write && yarn lint.eslint --fix",
"lint.eslint": "eslint --cache --cache-location .cache/.eslintcache --ext=.js,.mjs,.ts packages test-harness",
"lint.prettier": "prettier --ignore-path .eslintignore --ignore-unknown --check packages/core/src/ruleset/meta/*.json packages/rulesets/src/{asyncapi,oas,arazzo}/schemas/**/*.json docs/**/*.md README.md",
"lint.eslint": "eslint --cache --cache-location .cache/.eslintcache packages test-harness",
"lint.prettier": "prettier --ignore-path .prettierignore --ignore-unknown --check packages/core/src/ruleset/meta/*.json packages/rulesets/src/{asyncapi,oas,arazzo}/schemas/**/*.json docs/**/*.md README.md",
"pretest": "yarn workspaces foreach run pretest",
"test": "yarn pretest && yarn test.karma && yarn test.jest",
"pretest.harness": "ts-node -T test-harness/scripts/generate-tests.ts",
Expand Down Expand Up @@ -108,16 +108,17 @@
"@types/node-fetch": "^2.5.12",
"@types/node-powershell": "^3.1.1",
"@types/text-table": "^0.2.2",
"@typescript-eslint/eslint-plugin": "^5.35.1",
"@typescript-eslint/parser": "^5.34.0",
"eslint": "^8.22.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-prettier": "^4.2.1",
"@typescript-eslint/eslint-plugin": "^8.0.0",
"@typescript-eslint/parser": "^8.0.0",
"eslint": "^10.0.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-import-x": "^4.0.0",
"eslint-plugin-prettier": "^5.0.0",
"expect": "^27.5.1",
"fast-glob": "^3.3.3",
"fetch-mock": "^12.6.0",
"file-entry-cache": "^6.0.1",
"globals": "^16.0.0",
"husky": "^7.0.4",
"jest": "^29.7.0",
"jest-mock": "^29.7.0",
Expand All @@ -131,27 +132,28 @@
"multi-semantic-release": "^3.1.0",
"node-powershell": "^4.0.0",
"patch-package": "^8.0.0",
"prettier": "^2.4.1",
"prettier": "^3.0.0",
"semantic-release": "^25.0.3",
"ts-jest": "^29.2.5",
"ts-node": "^10.8.2",
"typescript": "4.7.4"
"typescript": "4.7.4",
"typescript-eslint": "^8.0.0"
},
"lint-staged": {
"*.{ts,js}": [
"eslint --fix --cache --cache-location .cache/.eslintcache"
],
"docs/**/*.md": [
"prettier --ignore-path .eslintignore --write"
"prettier --ignore-path .prettierignore --write"
],
"README.md": [
"prettier --write"
],
"packages/core/src/ruleset/meta/*.json": [
"prettier --ignore-path .eslintignore --write"
"prettier --ignore-path .prettierignore --write"
],
"packages/rulesets/src/{asyncapi,oas,arazzo}/schemas/**/*.json": [
"prettier --ignore-path .eslintignore --write"
"prettier --ignore-path .prettierignore --write"
]
},
"packageManager": "yarn@3.5.0"
Expand Down
3 changes: 1 addition & 2 deletions packages/cli/src/commands/lint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { DiagnosticSeverity, Dictionary } from '@stoplight/types';
import { isPlainObject } from '@stoplight/json';
import { getDiagnosticSeverity, IRuleResult } from '@stoplight/spectral-core';
import { difference, isError, pick } from 'lodash';
import type { ReadStream } from 'tty';
import type { CommandModule } from 'yargs';
import * as process from 'process';
import chalk from 'chalk';
Expand Down Expand Up @@ -38,7 +37,7 @@ const lintCommand: CommandModule = {
return [];
}

return [(process.stdin as ReadStream & { fd: 0 }).fd];
return [process.stdin.fd];
},
})
.middleware((argv: Dictionary<unknown>) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { DEFAULT_REQUEST_OPTIONS } from '@stoplight/spectral-runtime';
import lintCommand from './commands/lint';

if (typeof process.env.PROXY === 'string') {
// eslint-disable-next-line @typescript-eslint/no-var-requires
// eslint-disable-next-line @typescript-eslint/no-require-imports
const { HttpProxyAgent, HttpsProxyAgent } = require('hpagent') as typeof import('hpagent');
const httpAgent = new HttpProxyAgent({ proxy: process.env.PROXY });
const httpsAgent = new HttpsProxyAgent({ proxy: process.env.PROXY });
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/services/linter/utils/getResolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { CLIError } from '../../../errors';
export const getResolver = (resolver: Optional<string>): Resolver => {
if (resolver !== void 0) {
try {
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
// eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-unsafe-return
return require(isAbsolute(resolver) ? resolver : join(process.cwd(), resolver));
} catch (ex) {
throw new CLIError(isError(ex) ? formatMessage(ex.message) : String(ex));
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/services/linter/utils/getRuleset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ function load(source: string, uri: string): RulesetDefinition {

const _require = (id: string): unknown => req(req.resolve(id, { paths }));

// eslint-disable-next-line @typescript-eslint/no-implied-eval
// eslint-disable-next-line @typescript-eslint/no-implied-eval, @typescript-eslint/no-unsafe-call
Function('module, require', source)(m, _require);

if (!isObject(m.exports)) {
Expand Down
Loading
Loading