Skip to content
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
12 changes: 0 additions & 12 deletions .eslintignore

This file was deleted.

121 changes: 0 additions & 121 deletions .eslintrc.js

This file was deleted.

20 changes: 0 additions & 20 deletions .prettierrc

This file was deleted.

5 changes: 5 additions & 0 deletions .vscode-test.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/

const { defineConfig } = require('@vscode/test-cli');
const path = require('path');

Expand Down
2 changes: 2 additions & 0 deletions .vscodeignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ testWorkspace/**
.prettierrc
.swcrc
.travis.yml
eslint.config.mjs
prettier.config.mjs
gulp*
stats.json
test-results.xml
Expand Down
185 changes: 185 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,185 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/

import js from '@eslint/js';
import importPlugin from 'eslint-plugin-import';
import jest from 'eslint-plugin-jest';
import licenseHeader from 'eslint-plugin-license-header';
import mocha from 'eslint-plugin-mocha';
import globals from 'globals';
import ts from 'typescript-eslint';

export default ts.config(
{
ignores: [
'.azure-pipelines',
'.config',
'.github',
'.vscode-test',
'coverage',
'dist',
'out',
'node_modules',
'vscode-documentdb-api.d.ts',
'**/__mocks__/**/*',
'**/*.d.ts',
'**/jest.config.js',
'**/main.js',
],
},
{
extends: [js.configs.recommended],

plugins: {
import: importPlugin,
'license-header': licenseHeader,
},

languageOptions: {
globals: {
...globals.node,
},

ecmaVersion: 2023,
sourceType: 'module',
},

rules: {
eqeqeq: ['error', 'always'],
'import/consistent-type-specifier-style': ['error', 'prefer-inline'],
'import/no-internal-modules': ['error', { allow: ['antlr4ts/**', 'yaml/types'] }],
'no-case-declarations': 'error',
'no-constant-condition': 'error',
'no-inner-declarations': 'error',
'no-restricted-imports': ['error', { patterns: ['**/*/extension.bundle'] }],
'no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
'no-useless-escape': 'error',
'license-header/header': [
'error',
[
'/*---------------------------------------------------------------------------------------------',
' * Copyright (c) Microsoft Corporation. All rights reserved.',
' * Licensed under the MIT License. See License.txt in the project root for license information.',
' *--------------------------------------------------------------------------------------------*/',
],
],
},
},
{
files: ['**/*.ts', '**/*.tsx'],

extends: [ts.configs.recommendedTypeChecked],

plugins: {
'@typescript-eslint': ts.plugin,
},

languageOptions: {
parser: ts.parser,
ecmaVersion: 2023,
sourceType: 'module',

parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},

rules: {
'@typescript-eslint/consistent-type-imports': 'error',
'@typescript-eslint/no-base-to-string': 'warn',
'@typescript-eslint/no-inferrable-types': 'off',
'@typescript-eslint/no-namespace': 'off',
'@typescript-eslint/no-restricted-types': 'error',
'@typescript-eslint/no-unnecessary-type-assertion': 'off',
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
'@typescript-eslint/prefer-regexp-exec': 'off',
'@typescript-eslint/require-await': 'warn',
'@typescript-eslint/restrict-template-expressions': 'off',
'@typescript-eslint/unbound-method': 'warn',
},
},
{
files: ['src/**/*.test.ts', '**/__mocks__/**/*.js'],

extends: [ts.configs.recommendedTypeChecked, jest.configs['flat/recommended']],

plugins: {
'@typescript-eslint': ts.plugin,
jest: jest,
},

languageOptions: {
globals: {
...globals.node,
...globals.jest,
},

parser: ts.parser,
ecmaVersion: 2023,
sourceType: 'module',

parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},

rules: {
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-floating-promises': 'off',
'@typescript-eslint/no-misused-promises': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-return': 'off',
'@typescript-eslint/require-await': 'off',
'no-dupe-else-if': 'off',
'no-empty': 'off',
},
},
{
files: ['test/**/*.ts', '**/*.test.ts'],

extends: [ts.configs.recommendedTypeChecked],

plugins: {
'@typescript-eslint': ts.plugin,
mocha,
},

languageOptions: {
globals: {
...globals.node,
...globals.mocha,
},

parser: ts.parser,
ecmaVersion: 2023,
sourceType: 'module',

parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},

rules: {
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-floating-promises': 'off',
'@typescript-eslint/no-misused-promises': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-return': 'off',
'@typescript-eslint/require-await': 'off',
'no-dupe-else-if': 'off',
'no-empty': 'off',
'no-restricted-imports': 'off',
},
},
);
1 change: 0 additions & 1 deletion l10n/bundle.l10n.json
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@
"Do not save credentials.": "Do not save credentials.",
"Document must be an object.": "Document must be an object.",
"Document must be an object. Skipping…": "Document must be an object. Skipping…",
"DocumentDB Language Server": "DocumentDB Language Server",
"DocumentDB Local": "DocumentDB Local",
"Documents": "Documents",
"Does this occur consistently? <!-- TODO: Type Yes or No -->": "Does this occur consistently? <!-- TODO: Type Yes or No -->",
Expand Down
Loading