up
This commit is contained in:
@@ -1,30 +0,0 @@
|
||||
{
|
||||
"root": true,
|
||||
"parser": "@typescript-eslint/parser",
|
||||
"parserOptions": {
|
||||
"ecmaVersion": 6,
|
||||
"sourceType": "module"
|
||||
},
|
||||
"plugins": [
|
||||
"@typescript-eslint"
|
||||
],
|
||||
"rules": {
|
||||
"@typescript-eslint/naming-convention": [
|
||||
"warn",
|
||||
{
|
||||
"selector": "import",
|
||||
"format": [ "camelCase", "PascalCase" ]
|
||||
}
|
||||
],
|
||||
"@typescript-eslint/semi": "warn",
|
||||
"curly": "warn",
|
||||
"eqeqeq": "warn",
|
||||
"no-throw-literal": "warn",
|
||||
"semi": "off"
|
||||
},
|
||||
"ignorePatterns": [
|
||||
"out",
|
||||
"dist",
|
||||
"**/*.d.ts"
|
||||
]
|
||||
}
|
||||
66
eslint.config.js
Normal file
66
eslint.config.js
Normal file
@@ -0,0 +1,66 @@
|
||||
import js from '@eslint/js';
|
||||
import tsparser from '@typescript-eslint/parser';
|
||||
import tsplugin from '@typescript-eslint/eslint-plugin';
|
||||
import globals from 'globals';
|
||||
|
||||
export default [
|
||||
js.configs.recommended,
|
||||
{
|
||||
files: ['**/*.ts'],
|
||||
languageOptions: {
|
||||
parser: tsparser,
|
||||
parserOptions: {
|
||||
ecmaVersion: 6,
|
||||
sourceType: 'module',
|
||||
},
|
||||
globals: {
|
||||
...globals.browser,
|
||||
...globals.node,
|
||||
...globals.mocha,
|
||||
},
|
||||
},
|
||||
plugins: {
|
||||
'@typescript-eslint': tsplugin,
|
||||
},
|
||||
rules: {
|
||||
'@typescript-eslint/naming-convention': [
|
||||
'warn',
|
||||
{
|
||||
selector: 'import',
|
||||
format: ['camelCase', 'PascalCase'],
|
||||
},
|
||||
],
|
||||
'curly': 'warn',
|
||||
'eqeqeq': 'warn',
|
||||
'no-throw-literal': 'warn',
|
||||
'semi': 'off',
|
||||
// Règles générales réutilisées de flatbay
|
||||
'prefer-const': ['error', { destructuring: 'all' }],
|
||||
'no-var': 'error',
|
||||
'object-shorthand': ['error', 'properties'],
|
||||
'prefer-template': 'error',
|
||||
'dot-notation': 'error',
|
||||
'no-unused-expressions': 'error',
|
||||
'no-nested-ternary': 'error',
|
||||
'one-var-declaration-per-line': ['error', 'always'],
|
||||
'one-var': ['error', 'never'],
|
||||
'vars-on-top': 'error',
|
||||
'yoda': 'error',
|
||||
'prefer-arrow-callback': 'error',
|
||||
'no-implicit-globals': 'error',
|
||||
'no-labels': 'error',
|
||||
'no-new-func': 'error',
|
||||
'no-script-url': 'error',
|
||||
'no-sequences': 'error',
|
||||
'no-unused-labels': 'error',
|
||||
'prefer-spread': 'error',
|
||||
'no-console': 0, // Garder les console.log pour debug
|
||||
'no-empty': 0,
|
||||
'no-redeclare': 0,
|
||||
'no-useless-escape': 0,
|
||||
},
|
||||
},
|
||||
{
|
||||
ignores: ['out/', 'dist/', '**/*.d.ts'],
|
||||
},
|
||||
];
|
||||
@@ -12,6 +12,7 @@
|
||||
},
|
||||
"license": "ISC",
|
||||
"author": "Raphael Piccolo",
|
||||
"type": "module",
|
||||
"main": "./out/extension.js",
|
||||
"scripts": {
|
||||
"compile": "tsc -p ./",
|
||||
|
||||
@@ -4,13 +4,13 @@ export function activate(context: vscode.ExtensionContext) {
|
||||
console.log('Congratulations, your extension "vscodestat" is now active!');
|
||||
|
||||
// crée une commande de test
|
||||
let disposable = vscode.commands.registerCommand('vscodestat.helloWorld', () => {
|
||||
const disposable = vscode.commands.registerCommand('vscodestat.helloWorld', () => {
|
||||
vscode.window.showInformationMessage('Hello World from vscodestat!');
|
||||
});
|
||||
context.subscriptions.push(disposable);
|
||||
|
||||
// commande pour definir l'url
|
||||
let disposable2 = vscode.commands.registerCommand('vscodestat.setUrl', async () => {
|
||||
const disposable2 = vscode.commands.registerCommand('vscodestat.setUrl', async () => {
|
||||
const url = await vscode.window.showInputBox({
|
||||
prompt: 'Enter the URL:',
|
||||
placeHolder: ''
|
||||
@@ -24,7 +24,7 @@ export function activate(context: vscode.ExtensionContext) {
|
||||
context.subscriptions.push(disposable2);
|
||||
|
||||
// commande pour tester l'url
|
||||
let disposable3 = vscode.commands.registerCommand('vscodestat.callUrl', async () => {
|
||||
const disposable3 = vscode.commands.registerCommand('vscodestat.callUrl', async () => {
|
||||
const storedUrl = vscode.workspace.getConfiguration().get('vscodestat.url') as string;
|
||||
if (!storedUrl) {
|
||||
vscode.window.showWarningMessage('URL is not set. Please set the URL first.');
|
||||
|
||||
Reference in New Issue
Block a user