diff --git a/.eslintignore b/.eslintignore deleted file mode 100644 index 626941e2..00000000 --- a/.eslintignore +++ /dev/null @@ -1,4 +0,0 @@ -node_modules/ -build/ -src/formatter/bin -tmp/ diff --git a/.eslintrc b/.eslintrc deleted file mode 100644 index 78156d1c..00000000 --- a/.eslintrc +++ /dev/null @@ -1,25 +0,0 @@ -{ - "root": true, - "parser": "@typescript-eslint/parser", - "parserOptions": { - "ecmaVersion": 6, - "sourceType": "module" - }, - "plugins": [ - "@typescript-eslint" - ], - "rules": { - "no-console": "warn", - "@typescript-eslint/semi": "warn", - "curly": "warn", - "eqeqeq": "warn", - "no-throw-literal": "warn", - "semi": "warn", - "max-len": [ - "warn", - { - "code": 120 - } - ] - } -} \ No newline at end of file diff --git a/.eslintrc copy b/.eslintrc copy deleted file mode 100644 index a1d63ac0..00000000 --- a/.eslintrc copy +++ /dev/null @@ -1,27 +0,0 @@ -{ - "root": true, - "parser": "@typescript-eslint/parser", - "plugins": [ - "@typescript-eslint" - ], - "extends": [ - "eslint:recommended", - "plugin:@typescript-eslint/eslint-recommended", - "plugin:@typescript-eslint/recommended" - ], - "rules": { - "no-console": "warn", - "no-eval": "error", - "semi": "warn", - "eqeqeq": "warn", - "max-len": [ - "warn", - { - "code": 120 - } - ], - "no-tabs": "warn", - "curly": "warn", - "@typescript-eslint/no-var-requires": "off" - } -} \ No newline at end of file diff --git a/auto_package/script.yml b/auto_package/script.yml index 2cd640d7..1bc88aca 100644 --- a/auto_package/script.yml +++ b/auto_package/script.yml @@ -11,7 +11,7 @@ command: "npm run-script copy-files & npm run-script build-webviews & npm run-script build-webviews-configuration & tsc -p ./" - name: "lint" - command: "eslint src --ext ts" + command: "eslint src" - name: "watch" command: npm run-script copy-files & tsc --watch --p ./tsconfig.json & nodemon --ignore 'resources/webviews/reporters/**/wb/' --watch resources/webviews/reporters -e js,ts,tsx,html --exec \"npm run-script build-webviews\" diff --git a/copy_files2.py b/copy_files2.py deleted file mode 100644 index abe5b6b1..00000000 --- a/copy_files2.py +++ /dev/null @@ -1,42 +0,0 @@ -import os -import shutil - -import os -import shutil - -def copy_files_except_extensions(src_dir, out_dir, excluded_extensions): - """ - Copy files from the source directory to the output directory, excluding files with specified extensions. - - Args: - src_dir (str): The path to the source directory. - out_dir (str): The path to the output directory. - excluded_extensions (list): A list of file extensions to exclude. - - Returns: - None - """ - for root, dirs, files in os.walk(src_dir): - for file in files: - if not any(file.endswith(ext) for ext in excluded_extensions): - src_path = os.path.abspath(os.path.join(root, file)) - - src_path_parent_dir = os.path.relpath(root, src_dir) - if len(src_path_parent_dir.split(os.sep)) > 1: - src_path_parent_dir = f"{os.sep}".join(src_path_parent_dir.split(os.sep)[1:]) - else: - src_path_parent_dir = "." - - complete_dest_path = os.path.abspath(os.path.join(out_dir, src_path_parent_dir, file)) - - os.makedirs(os.path.dirname(complete_dest_path), exist_ok=True) - shutil.copy2(src_path, complete_dest_path) - -src_directory = '../colibri/src' -out_directory = 'build' - -excluded_extensions = ['.ts', '.js', '.log'] - -copy_files_except_extensions(src_directory, out_directory, excluded_extensions) - -print("Files copied successfully!") diff --git a/eslint.config.js b/eslint.config.js new file mode 100644 index 00000000..25fadf85 --- /dev/null +++ b/eslint.config.js @@ -0,0 +1,33 @@ +const parser = require('@typescript-eslint/parser'); +const eslintPlugin = require('@typescript-eslint/eslint-plugin'); + +module.exports = { + languageOptions: { + parser: parser, + ecmaVersion: 6, + sourceType: 'module' + }, + plugins: { + '@typescript-eslint': eslintPlugin, + }, + files: ["src/**/*.ts"], + ignores: [ + 'node_modules', + 'build', + 'src/formatter/bin', + 'tmp', + ], + rules: { + 'no-console': 'warn', + 'curly': 'warn', + 'eqeqeq': 'warn', + 'no-throw-literal': 'warn', + 'semi': 'warn', + 'max-len': [ + 'warn', + { + code: 120 + } + ] + } +}; \ No newline at end of file diff --git a/package.json b/package.json index 6dc6b880..312fc710 100644 --- a/package.json +++ b/package.json @@ -834,7 +834,7 @@ "clean": "shx rm -rf out", "vscode:prepublish": "npm run generate-examples & npm run compile", "compile": "npm run-script copy-files & npm run-script build-webviews & npm run-script build-webviews-configuration & tsc -p ./", - "lint": "eslint src --ext ts", + "lint": "eslint src", "watch": "npm run-script copy-files & tsc --watch --p ./tsconfig.json & nodemon --ignore 'resources/webviews/reporters/**/wb/' --watch resources/webviews/reporters -e js,ts,tsx,html --exec \"npm run-script build-webviews\"", "generate-examples": "cd ./resources/project_manager; ./copy_examples.sh", "pre-package": "mkdir ./node_modules/teroshdl2/node_modules/onml/lib; cp ./node_modules/teroshdl2/node_modules/onml/*.js ./node_modules/teroshdl2/node_modules/onml/lib",