fix(chore): Support linting for cjs (#18639)

Co-authored-by: Gal Zahavi <38544478+galz10@users.noreply.github.com>
This commit is contained in:
Aswin Ashok
2026-02-10 00:06:16 +05:30
committed by GitHub
parent cb7fca01b2
commit 469cbca67f
5 changed files with 46 additions and 8 deletions

View File

@@ -1,5 +1,9 @@
/* eslint-disable @typescript-eslint/no-require-imports */
/* global process, console, require */
/**
* @license
* Copyright 2026 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
const { Octokit } = require('@octokit/rest');
/**

View File

@@ -37,7 +37,6 @@ export default tseslint.config(
'dist/**',
'evals/**',
'packages/test-utils/**',
'packages/core/src/skills/builtin/skill-creator/scripts/*.cjs',
],
},
eslint.configs.recommended,
@@ -243,7 +242,7 @@ export default tseslint.config(
},
},
{
files: ['./**/*.{tsx,ts,js}'],
files: ['./**/*.{tsx,ts,js,cjs}'],
plugins: {
headers,
import: importPlugin,
@@ -269,7 +268,6 @@ export default tseslint.config(
'import/enforce-node-protocol-usage': ['error', 'always'],
},
},
// extra settings for scripts that we run directly with node
{
files: ['./scripts/**/*.js', 'esbuild.config.js'],
languageOptions: {
@@ -290,6 +288,30 @@ export default tseslint.config(
],
},
},
{
files: ['**/*.cjs'],
languageOptions: {
sourceType: 'commonjs',
globals: {
...globals.node,
},
},
rules: {
'no-restricted-syntax': 'off',
'no-console': 'off',
'no-empty': 'off',
'no-redeclare': 'off',
'@typescript-eslint/no-require-imports': 'off',
'@typescript-eslint/no-unused-vars': [
'error',
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
caughtErrorsIgnorePattern: '^_',
},
],
},
},
{
files: ['packages/vscode-ide-companion/esbuild.js'],
languageOptions: {

View File

@@ -1,6 +1,10 @@
#!/usr/bin/env node
/* eslint-env node */
/**
* @license
* Copyright 2026 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
/**
* Skill Initializer - Creates a new skill from template

View File

@@ -1,6 +1,10 @@
#!/usr/bin/env node
/* eslint-env node */
/**
* @license
* Copyright 2026 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
/**
* Skill Packager - Creates a distributable .skill file of a skill folder

View File

@@ -1,4 +1,8 @@
/* eslint-env node */
/**
* @license
* Copyright 2026 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
/**
* Quick validation logic for skills.