Skip to content

Commit

Permalink
Updated to eslint 9 and monaco-vscode-api 10.1.0
Browse files Browse the repository at this point in the history
- Configuration has been converted and all plugins have been updated to current versions
  • Loading branch information
kaisalmen committed Oct 21, 2024
1 parent 834db30 commit 6f91c0c
Show file tree
Hide file tree
Showing 20 changed files with 2,038 additions and 1,557 deletions.
88 changes: 0 additions & 88 deletions .eslintrc.cjs

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ loader.config({ monaco });
If you use pnpm, you have to add `vscode` / `@codingame/monaco-vscode-api` as direct dependency (you find the [compatibility table here](https://github.com/TypeFox/monaco-languageclient/blob/main/docs/versions-and-history.md#monaco-editor--codingamemonaco-vscode-api-compatibility-table), otherwise the installation will fail.

```json
"vscode": "npm:@codingame/monaco-vscode-api@~10.0.2"
"vscode": "npm:@codingame/monaco-vscode-api@~10.1.0"
```

## Licenses
Expand Down
2 changes: 1 addition & 1 deletion docs/versions-and-history.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The following table describes which version of **monaco-languageclient** and **@

| monaco-languageclient | monaco-editor-wrapper | monaco-editor-react | monaco-vscode-api / editor-api | vscode | monaco-editor | release date | comment |
| :---- | :---- | :--- | :--- | :--- | :--- | :--- | :--- |
| 9.0.0-next.3 | 6.0.0-next.3 | 6.0.0-next.3 | 10.0.1 | 1.94.1 | 0.52.0 | 2024-10-10 | |
| 9.0.0-next.4 | 6.0.0-next.4 | 6.0.0-next.4 | 10.1.0 | 1.94.2 | 0.52.0 | 2024-10-22 | |
| 8.8.3 | 5.5.3 | 4.5.3 | 8.0.4 | 1.92.2 | 0.51.0 | 2024-08-26 | |
| 8.8.2 | 5.5.2 | 4.5.2 | 8.0.2 | 1.92.2 | 0.50.0 | 2024-08-21 | |
| 8.8.1 | 5.5.1 | 4.5.1 | 8.0.1 | 1.92.1 | 0.50.0 | 2024-08-12 | |
Expand Down
121 changes: 121 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
import js from '@eslint/js';
import globals from 'globals';
import { FlatCompat } from '@eslint/eslintrc';
import tsParser from '@typescript-eslint/parser';

import pluginTypescriptEslint from '@typescript-eslint/eslint-plugin';
import pluginImport from 'eslint-plugin-import';
import pluginUnusedImports from 'eslint-plugin-unused-imports';
import pluginHeader from 'eslint-plugin-header';
import pluginStylistic from '@stylistic/eslint-plugin'

import path from 'node:path';
import { fileURLToPath } from 'node:url';

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);

const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all
});

// Workaround, see https://github.com/Stuk/eslint-plugin-header/issues/57#issuecomment-2378485611
pluginHeader.rules.header.meta.schema = false;

export default [{
ignores: [
'**/node_modules/**/*',
'**/dist/**/*',
'**/lib/**/*',
'**/out/**/*',
'**/bin/**/*',
'**/resources/**/*'
],
}, ...compat.extends('eslint:recommended', 'plugin:@typescript-eslint/recommended'), {
files: [
'**/src/**/*.ts',
'**/src/**/*.tsx',
'**/test/**/*.ts',
'**/test/**/*.tsx'
],
plugins: {
'@typescript-eslint': pluginTypescriptEslint,
import: pluginImport,
'unused-imports': pluginUnusedImports,
pluginHeader,
'@stylistic': pluginStylistic
},
languageOptions: {
globals: {
...globals.node,
...globals.browser
},
parser: tsParser,
ecmaVersion: 2022,
sourceType: 'module',
parserOptions: {
project: ['./tsconfig.json']
}
},
rules: {
'arrow-parens': ['off', 'as-needed'],
'constructor-super': 'error',
'dot-notation': 'error',
eqeqeq: 'error',
'guard-for-in': 'error',
'new-parens': 'error',
'no-bitwise': 'error',
'no-caller': 'error',
'no-cond-assign': 'error',
'no-debugger': 'error',
'no-eval': 'error',
'no-inner-declarations': 'off',
'no-labels': 'error',
'no-multiple-empty-lines': ['error', {
max: 1
}],
'no-new-wrappers': 'error',
'no-throw-literal': 'error',
'no-trailing-spaces': 'error',
'no-unsafe-finally': 'error',
'no-var': 'error',
'space-before-function-paren': ['error', {
anonymous: 'never',
asyncArrow: 'always',
named: 'never'
}],
semi: [2, 'always'],
quotes: [2, 'single', {
avoidEscape: true
}],
'use-isnan': 'error',
'pluginHeader/header': [2, 'block', {
pattern: 'MIT License|DO NOT EDIT MANUALLY!'
}],
'@typescript-eslint/adjacent-overload-signatures': 'error',
'@typescript-eslint/array-type': ['error', {
default: 'array-simple'
}],
'@typescript-eslint/no-empty-object-type': 'error',
'@typescript-eslint/no-unsafe-function-type': 'error',
'@typescript-eslint/no-wrapper-object-types': 'error',
'@stylistic/indent': 'error',
'@typescript-eslint/no-explicit-any': 'error',
'@typescript-eslint/no-misused-new': 'error',
'@typescript-eslint/no-namespace': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/parameter-properties': 'error',
'@typescript-eslint/no-unused-vars': ['error', {
argsIgnorePattern: '^_'
}],
'@typescript-eslint/no-var-requires': 'error',
'@typescript-eslint/prefer-for-of': 'error',
'@typescript-eslint/prefer-namespace-keyword': 'error',
'@typescript-eslint/triple-slash-reference': 'error',
'@stylistic/type-annotation-spacing': 'error',
'@typescript-eslint/strict-boolean-expressions': 'error',
'@typescript-eslint/no-unnecessary-condition': 'error'
}
}];
Loading

0 comments on commit 6f91c0c

Please sign in to comment.