8000 Upgrade to ESLint 9.x. by filipsobol · Pull Request #357 · ckeditor/ckeditor5-vue · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Upgrade to ESLint 9.x. #357

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
May 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
48 changes: 0 additions & 48 deletions .eslintrc.cjs

This file was deleted.

94 changes: 94 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
/**
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/

import globals from 'globals';
import { defineConfig } from 'eslint/config';
import ckeditor5Rules from 'eslint-plugin-ckeditor5-rules';
import ckeditor5Config from 'eslint-config-ckeditor5';
import pluginVue from 'eslint-plugin-vue';
import ts from 'typescript-eslint';

export default defineConfig( [
{
ignores: [
'coverage/**',
'dist/**',
'release/**'
]
},

{
extends: ckeditor5Config,

languageOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
globals: {
...globals.browser
}
},

linterOptions: {
reportUnusedDisableDirectives: 'warn',
reportUnusedInlineConfigs: 'warn'
},

plugins: {
'ckeditor5-rules': ckeditor5Rules
},

rules: {
'ckeditor5-rules/license-header': [ 'error', { headerLines: [
'/**',
' * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.',
' * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options',
' */'
] } ],
'ckeditor5-rules/require-file-extensions-in-imports': [
'error',
{
extensions: [ '.ts', '.js', '.json' ]
}
],
'ckeditor5-rules/prevent-license-key-leak': 'error',
'no-unused-vars': 'off'
}
},

// Rules recommended by the Vue plugin that apply to all files.
{
extends: pluginVue.configs[ 'flat/recommended' ],

rules: {
'vue/multi-word-component-names': 'off'
}
},

// Rules specific to `.vue` files.
{
files: [ '**/*.vue' ],

languageOptions: {
parserOptions: {
parser: ts.parser
}
},

rules: {
'ckeditor5-rules/license-header': 'off'
}
},

// Rules specific to `scripts` folder.
{
files: [ 'scripts/**/*' ],

languageOptions: {
globals: {
...globals.node
}
}
}
] );
20 changes: 9 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,11 @@
"ckeditor5": "^44.3.0",
"ckeditor5-premium-features": "^44.3.0",
"coveralls": "^3.1.1",
"eslint": "^7.32.0",
"eslint-config-ckeditor5": "^7.1.0",
"eslint-plugin-vue": "^9.9.0",
"eslint": "^9.26.0",
"eslint-config-ckeditor5": "^10.0.0-alpha.0",
"eslint-plugin-ckeditor5-rules": "^10.0.0-alpha.0",
"eslint-plugin-vue": "^10.1.0",
"globals": "^16.1.0",
"husky": "^8.0.2",
"lint-staged": "^10.2.11",
"listr2": "^6.5.0",
Expand All @@ -63,7 +65,7 @@
"vite": "^5.3.1",
"vitest": "^2.1.9",
"vue": "^3.4.30",
"vue-eslint-parser": "^9.1.0",
"vue-eslint-parser": "^10.1.3",
"vue-tsc": "^2.1.6",
"webdriverio": "^9.12.7"
},
Expand All @@ -74,15 +76,15 @@
"ws": "^8"
},
"engines": {
"node": ">=20.0.0"
"node": ">=22.0.0"
},
"scripts": {
"dev": "vite",
"build": "tsc --noEmit && vite build && vue-tsc --emitDeclarationOnly",
"test": "vitest run --coverage",
"test:watch": "vitest --ui --watch",
"test:check:types": "tsc --noEmit -p ./tests/tsconfig.json",
"lint": "eslint \"{demos,src,tests}/**/*.{ts,vue}\"",
"lint": "eslint",
"postinstall": "node ./scripts/postinstall.js",
"changelog": "node ./scripts/changelog.js",
"release:prepare-packages": "node ./scripts/preparepackages.js",
Expand All @@ -104,12 +106,8 @@
"url": "https://github.com/ckeditor/ckeditor5-vue/issues"
},
"homepage": "https://github.com/ckeditor/ckeditor5-vue",
"eslintIgnore": [
"coverage/**",
"dist/**"
],
"lint-staged": {
"**/*.{js,ts,vue}": [
"**/*": [
"eslint --quiet"
]
}
Expand Down
2 changes: 0 additions & 2 deletions scripts/bump-year.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/

/* eslint-env node */

/*

Usage:
Expand Down
2 changes: 0 additions & 2 deletions scripts/changelog.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/

/* eslint-env node */

import parseArguments from './utils/parsearguments.js';

/**
Expand Down
2 changes: 0 additions & 2 deletions scripts/ci/is-project-ready-to-release.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/

/* eslint-env node */

import { createRequire } from 'module';
import * as releaseTools from '@ckeditor/ckeditor5-dev-release-tools';

Expand Down
2 changes: 0 additions & 2 deletions scripts/postinstall.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/

/* eslint-env node */

import { fileURLToPath } from 'url';
import { join, dirname } from 'path';
import { existsSync } from 'fs';
Expand Down
8 changes: 2 additions & 6 deletions scripts/preparepackages.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,12 @@
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/

/* eslint-env node */

import { createRequire } from 'module';
import { Listr } from 'listr2';
import * as releaseTools from '@ckeditor/ckeditor5-dev-release-tools';
import * as devUtils from '@ckeditor/ckeditor5-dev-utils';
import parseArguments from './utils/parsearguments.js';
import getListrOptions from './utils/getlistroptions.js';

const require = createRequire( import.meta.url );
import { preparePackageJson } from './utils/preparepackagejson.js';

const latestVersion = releaseTools.getLastFromChangelog();
const versionChangelog = releaseTools.getChangesForVersion( latestVersion );
Expand Down Expand Up @@ -73,7 +69,7 @@ const tasks = new Listr( [
task: () => {
return releaseTools.prepareRepository( {
outputDirectory: 'release',
rootPackageJson: require( '../package.json' )
rootPackageJson: preparePackageJson()
} );
}
},
Expand Down
2 changes: 0 additions & 2 deletions scripts/publishpackages.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/

/* eslint-env node */

import { Listr } from 'listr2';
import * as releaseTools from '@ckeditor/ckeditor5-dev-release-tools';
import parseArguments from './utils/parsearguments.js';
Expand Down
2 changes: 0 additions & 2 deletions scripts/utils/getlistroptions.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/

/* eslint-env node */

/**
* @param {ReleaseOptions} cliArguments
* @returns {Object}
Expand Down
2 changes: 0 additions & 2 deletions scripts/utils/parsearguments.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/

/* eslint-env node */

import minimist from 'minimist';

/**
Expand Down
14 changes: 14 additions & 0 deletions scripts/utils/preparepackagejson.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/**
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/

import packageJson from '../../package.json' with { type: 'json' };

export function preparePackageJson() {
if ( packageJson.engines ) {
delete packageJson.engines;
}

return packageJson;
}
1 change: 0 additions & 1 deletion src/plugin.ts
Original file line number Diff lin F4A4 e number Diff line change
Expand Up @@ -3,7 +3,6 @@
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/

/* eslint-env browser */
import * as Vue from 'vue';
import Ckeditor from './ckeditor.vue';

Expand Down
2 changes: 1 addition & 1 deletion tests/globals.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ declare module '*.vue' {
const Component: DefineComponent<object, object, any>;

export default Component;
}
}
2 changes: 0 additions & 2 deletions vitest-setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,4 @@
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/

// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
window.CKEDITOR_GLOBAL_LICENSE_KEY = 'GPL';
Loading
0