Skip to content

Commit

Permalink
Merge branch 'main' into pr/a-stewart/154079
Browse files Browse the repository at this point in the history
  • Loading branch information
jrieken committed Sep 8, 2022
2 parents 32037c7 + b8afe8d commit f3f9f7a
Show file tree
Hide file tree
Showing 1,950 changed files with 53,157 additions and 36,400 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
import * as eslint from 'eslint';
import { TSESTree } from '@typescript-eslint/experimental-utils';
import * as path from 'path';
import * as minimatch from 'minimatch';
import minimatch from 'minimatch';
import { createImportRuleListener } from './utils';

const REPO_ROOT = path.normalize(path.join(__dirname, '../../../'));
const REPO_ROOT = path.normalize(path.join(__dirname, '../'));

interface ConditionalPattern {
when?: 'hasBrowser' | 'hasNode' | 'test';
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
12 changes: 12 additions & 0 deletions .eslintplugin/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const glob = require('glob');
const path = require('path');

require('ts-node').register({ experimentalResolver: true, transpileOnly: true });

// Re-export all .ts files as rules
const rules = {};
glob.sync(`${__dirname}/*.ts`).forEach((file) => {
rules[path.basename(file, '.ts')] = require(file);
});

exports.rules = rules;
26 changes: 26 additions & 0 deletions .eslintplugin/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"compilerOptions": {
"target": "es2020",
"lib": [
"ES2020"
],
"module": "commonjs",
"esModuleInterop": true,
"alwaysStrict": true,
"allowJs": true,
"strict": true,
"exactOptionalPropertyTypes": false,
"useUnknownInCatchVariables": false,
"noUnusedLocals": true,
"noUnusedParameters": true,
"newLine": "lf",
"noEmit": true
},
"include": [
"**/*.ts",
"**/*.js"
],
"exclude": [
"node_modules/**"
]
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,10 @@ export = new class ApiEventNaming implements eslint.Rule.RuleModule {

if (def.type === AST_NODE_TYPES.Identifier) {
return def;
} else if ((def.type === AST_NODE_TYPES.TSPropertySignature || def.type === AST_NODE_TYPES.Property) && def.key.type === AST_NODE_TYPES.Identifier) {
} else if ((def.type === AST_NODE_TYPES.TSPropertySignature || def.type === AST_NODE_TYPES.PropertyDefinition) && def.key.type === AST_NODE_TYPES.Identifier) {
return def.key;
}

return this.getIdent(def.parent);
}
};

File renamed without changes.
File renamed without changes.
File renamed without changes.
71 changes: 26 additions & 45 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"plugins": [
"@typescript-eslint",
"jsdoc",
"header"
"header",
"local"
],
"rules": {
"constructor-super": "warn",
Expand Down Expand Up @@ -61,17 +62,17 @@
]
}
],
"code-no-unused-expressions": [
"local/code-no-unused-expressions": [
"warn",
{
"allowTernary": true
}
],
"code-translation-remind": "warn",
"code-no-nls-in-standalone-editor": "warn",
"code-no-standalone-editor": "warn",
"code-no-unexternalized-strings": "warn",
"code-layering": [
"local/code-translation-remind": "warn",
"local/code-no-nls-in-standalone-editor": "warn",
"local/code-no-standalone-editor": "warn",
"local/code-no-unexternalized-strings": "warn",
"local/code-layering": [
"warn",
{
"common": [],
Expand Down Expand Up @@ -122,8 +123,8 @@
"**/*.test.ts"
],
"rules": {
"code-no-test-only": "error",
"code-no-unexternalized-strings": "off"
"local/code-no-test-only": "error",
"local/code-no-unexternalized-strings": "off"
}
},
{
Expand All @@ -132,14 +133,14 @@
"**/vscode.proposed.*.d.ts"
],
"rules": {
"vscode-dts-create-func": "warn",
"vscode-dts-literal-or-types": "warn",
"vscode-dts-interface-naming": "warn",
"vscode-dts-cancellation": "warn",
"vscode-dts-use-thenable": "warn",
"vscode-dts-region-comments": "warn",
"vscode-dts-vscode-in-comments": "warn",
"vscode-dts-provider-naming": [
"local/vscode-dts-create-func": "warn",
"local/vscode-dts-literal-or-types": "warn",
"local/vscode-dts-interface-naming": "warn",
"local/vscode-dts-cancellation": "warn",
"local/vscode-dts-use-thenable": "warn",
"local/vscode-dts-region-comments": "warn",
"local/vscode-dts-vscode-in-comments": "warn",
"local/vscode-dts-provider-naming": [
"warn",
{
"allowed": [
Expand All @@ -154,7 +155,7 @@
]
}
],
"vscode-dts-event-naming": [
"local/vscode-dts-event-naming": [
"warn",
{
"allowed": [
Expand Down Expand Up @@ -200,8 +201,8 @@
"src/**/*.ts"
],
"rules": {
"code-no-look-behind-regex": "warn",
"code-import-patterns": [
"local/code-no-look-behind-regex": "warn",
"local/code-import-patterns": [
"warn",
{
// imports that are allowed in all files of layers:
Expand All @@ -210,8 +211,7 @@
// - electron-browser
"when": "hasBrowser",
"allow": [
"vs/css!./**/*",
"@microsoft/applicationinsights-web"
"vs/css!./**/*"
]
},
{
Expand All @@ -226,7 +226,6 @@
"@vscode/vscode-languagedetection",
"@vscode/ripgrep",
"@vscode/iconv-lite-umd",
"applicationinsights",
"assert",
"child_process",
"console",
Expand Down Expand Up @@ -261,6 +260,7 @@
"windows-process-tree",
"worker_threads",
"xterm",
"xterm-addon-canvas",
"xterm-addon-search",
"xterm-addon-serialize",
"xterm-addon-unicode11",
Expand Down Expand Up @@ -536,27 +536,9 @@
"vs/workbench/workbench.common.main"
]
},
{
"target": "src/vs/workbench/{workbench.sandbox.main.ts,workbench.desktop.sandbox.main.ts}",
"layer": "electron-sandbox",
"restrictions": [
"vs/base/*/~",
"vs/base/parts/*/~",
"vs/platform/*/~",
"vs/editor/~",
"vs/editor/contrib/*/~",
"vs/editor/editor.all",
"vs/workbench/~",
"vs/workbench/api/~",
"vs/workbench/services/*/~",
"vs/workbench/contrib/*/~",
"vs/workbench/workbench.common.main",
"vs/workbench/workbench.sandbox.main"
]
},
{
"target": "src/vs/workbench/workbench.desktop.main.ts",
"layer": "electron-browser",
"layer": "electron-sandbox",
"restrictions": [
"vs/base/*/~",
"vs/base/parts/*/~",
Expand All @@ -568,8 +550,7 @@
"vs/workbench/api/~",
"vs/workbench/services/*/~",
"vs/workbench/contrib/*/~",
"vs/workbench/workbench.common.main",
"vs/workbench/workbench.sandbox.main"
"vs/workbench/workbench.common.main"
]
},
{
Expand All @@ -596,7 +577,7 @@
"test/**/*.ts"
],
"rules": {
"code-import-patterns": [
"local/code-import-patterns": [
"warn",
{
"target": "test/smoke/**",
Expand Down
Loading

0 comments on commit f3f9f7a

Please sign in to comment.