vscode-js-debug/.eslintrc.js

44 строки
1.6 KiB
JavaScript
Исходник Постоянная ссылка Обычный вид История

2019-12-11 21:21:38 +03:00
module.exports = {
2020-10-08 02:19:03 +03:00
ignorePatterns: ['**/*.d.ts', 'src/test/**/*.ts', 'demos/**/*', '**/*.js', 'testWorkspace/**'],
2019-12-11 21:21:38 +03:00
parser: '@typescript-eslint/parser',
2020-10-08 02:19:03 +03:00
extends: ['plugin:react/recommended', 'plugin:@typescript-eslint/recommended'],
2019-12-11 21:21:38 +03:00
plugins: ['header'],
parserOptions: {
ecmaVersion: 2018, // Allows for the parsing of modern ECMAScript features
sourceType: 'module', // Allows for the use of imports
},
2020-10-08 02:19:03 +03:00
settings: {
react: {
pragma: 'h',
version: '16.3',
},
},
2019-12-11 21:21:38 +03:00
rules: {
2021-06-23 20:27:02 +03:00
// Temporary until CDP is moved out, which is where most violations are:
'@typescript-eslint/ban-types': 'off',
'@typescript-eslint/no-var-requires': 'off',
2019-12-11 21:21:38 +03:00
'@typescript-eslint/no-use-before-define': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
use ioc and a more CDP-like protocol I adjusted some of the protocol. Previously we 'wrapped' CDP in our custom messages. I think layering a second custom protocol on here is not that useful and can make life harder for implementors. Instead, the websocket exposes a literal CDP protocol, but with an extra `JsDebug` domain that exposes the `subscribe` method. Usage looks something like this: ``` Connected (press CTRL+C to quit) > {"method":"Debugger.somethingInvalid", "params": {}, "id": 42} < {"id":42,"error":{"code":-32601,"message":"'Debugger.somethingInvalid' wasn't found"}} > {"method":"JsDebug.subscribe", "params": { "events": ["Debugger.resumed"] }, "id": 42} < {"id":42,"result":{}} > {"method":"Debugger.resume", "params": {}, "id": 42} < {"method":"Debugger.resumed","params":{}} < {"id":42,"result":{}} > {"method":"JsDebug.subscribe", "params": { "events": ["Debugger.*"] }, "id": 42} < {"id":42,"result":{}} > {"method":"Debugger.resume", "params": {}, "id": 42} < {"id":42,"result":{}} < {"method":"Debugger.resumed","params":{}} < {"method":"Debugger.resumed","params":{}} < {"method":"Debugger.paused","params":{"callFrames":[... ``` To makes these calls and get response errors, I now expose the `CDPSession` object on the `Cdp.Api`. This is pretty low level, but it solves the problem of error handling well. I added the "wildcard" event subscribing mentioned before. I also removed the command from the UI since it's something that only extensions will call. For testing I made a simple extension to run this command. [1] Later on (not in this PR) I want to have smarter domain enablement handling. For example, when profiling we disable the debugger. There should be some prioritization of enablements and disablements. 1. https://github.com/connor4312/cdp-proxy-requestor
2021-04-07 00:56:21 +03:00
'@typescript-eslint/no-namespace': 'off',
'prefer-const': ['error', { destructuring: 'all' }],
2021-06-23 20:27:02 +03:00
'@typescript-eslint/explicit-module-boundary-types': 'off',
2019-12-11 21:21:38 +03:00
'header/header': [
'error',
'block',
'---------------------------------------------------------\n * Copyright (C) Microsoft Corporation. All rights reserved.\n *--------------------------------------------------------',
],
2020-10-09 02:56:29 +03:00
'react/no-unescaped-entities': 'off',
2020-10-08 02:19:03 +03:00
'react/prop-types': 'off',
'@typescript-eslint/no-unused-vars': [
'warn',
{
varsIgnorePattern: '^h$',
argsIgnorePattern: '^_',
2020-10-08 02:19:03 +03:00
},
],
2019-12-11 21:21:38 +03:00
// Place to specify ESLint rules. Can be used to overwrite rules specified from the extended configs
// e.g. "@typescript-eslint/explicit-function-return-type": "off",
},
};