Skip to content
Draft
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
20 changes: 12 additions & 8 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
/**
* ESLint Configuration for VS Code Python Extension
* This file configures linting rules for the TypeScript/JavaScript codebase.
* It uses the new flat config format introduced in ESLint 8.21.0
* It uses the flat config format (eslint.config.mjs).
*/

// Import essential ESLint plugins and configurations
import tseslint from '@typescript-eslint/eslint-plugin';
import tsParser from '@typescript-eslint/parser';
import noOnlyTests from 'eslint-plugin-no-only-tests';
import prettier from 'eslint-config-prettier';
import importPlugin from 'eslint-plugin-import';
import importPlugin from 'eslint-plugin-import-x';
import js from '@eslint/js';
import noBadGdprCommentPlugin from './.eslintplugin/no-bad-gdpr-comment.js'; // Ensure the path is correct

Expand Down Expand Up @@ -243,6 +243,10 @@ export default [
rules: {
...js.configs.recommended.rules,
'no-undef': 'off',
// New ESLint 10 rules added to recommended — turn off to avoid flagging pre-existing code
'no-unassigned-vars': 'off',
'no-useless-assignment': 'off',
'preserve-caught-error': 'off',
},
},
// TypeScript-specific configuration
Expand Down Expand Up @@ -273,7 +277,6 @@ export default [
'@typescript-eslint': tseslint,
'no-only-tests': noOnlyTests,
import: importPlugin,
prettier: prettier,
'no-bad-gdpr-comment': noBadGdprCommentPlugin, // Register your plugin
},
settings: {
Expand All @@ -296,21 +299,21 @@ export default [
'ts-ignore': 'allow-with-description',
},
],
'@typescript-eslint/ban-types': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-empty-interface': 'off',
'@typescript-eslint/no-empty-object-type': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-namespace': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-loss-of-precision': 'off',
'@typescript-eslint/no-unsafe-function-type': 'off',
'@typescript-eslint/no-wrapper-object-types': 'off',
'@typescript-eslint/no-unused-vars': [
'warn',
{
varsIgnorePattern: '^_',
argsIgnorePattern: '^_',
},
],
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/no-require-imports': 'off',
'@typescript-eslint/no-use-before-define': [
'error',
{
Expand Down Expand Up @@ -366,7 +369,8 @@ export default [
'no-useless-escape': 'off',
'no-extra-parentheses': 'off',
'no-extra-paren': 'off',
'@typescript-eslint/no-extra-parens': 'off',
// @typescript-eslint/no-unused-expressions is new in v8 recommended; off to keep existing chai patterns working
'@typescript-eslint/no-unused-expressions': 'off',
strict: 'off',

// Restricted syntax
Expand Down
26 changes: 13 additions & 13 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
'use strict';

const gulp = require('gulp');
const ts = require('gulp-typescript');
const spawn = require('cross-spawn');
const path = require('path');
const del = require('del');
Expand All @@ -20,22 +19,23 @@ const nativeDependencyChecker = require('node-has-native-dependencies');
const flat = require('flat');
const { argv } = require('yargs');
const os = require('os');
const typescript = require('typescript');

const tsProject = ts.createProject('./tsconfig.json', { typescript });

const isCI = process.env.TRAVIS === 'true' || process.env.TF_BUILD !== undefined;

gulp.task('compileCore', (done) => {
let failed = false;
tsProject
.src()
.pipe(tsProject())
.on('error', () => {
failed = true;
})
.js.pipe(gulp.dest('out'))
.on('finish', () => (failed ? done(new Error('TypeScript compilation errors')) : done()));
const proc = spawn('node', [path.join('node_modules', 'typescript', 'bin', 'tsc'), '-p', './tsconfig.json'], {
cwd: __dirname,
env: process.env,
stdio: 'inherit',
});
proc.on('close', (code) => {
if (code === 0) {
done();
} else {
done(new Error(`TypeScript compilation failed with exit code ${code}`));
}
});
proc.on('error', (error) => done(error));
});

gulp.task('compileApi', (done) => {
Expand Down
Loading
Loading