mirror of
https://github.com/sst/opencode.git
synced 2025-08-31 10:17:26 +00:00
42 lines
1 KiB
JavaScript
42 lines
1 KiB
JavaScript
// @ts-check
|
|
import tseslint from 'typescript-eslint';
|
|
import unusedImports from 'eslint-plugin-unused-imports';
|
|
import prettier from 'eslint-plugin-prettier';
|
|
|
|
export default tseslint.config(
|
|
{
|
|
languageOptions: {
|
|
parser: tseslint.parser,
|
|
parserOptions: { sourceType: 'module' },
|
|
},
|
|
files: ['**/*.ts', '**/*.mts', '**/*.cts', '**/*.js', '**/*.mjs', '**/*.cjs'],
|
|
ignores: ['dist/'],
|
|
plugins: {
|
|
'@typescript-eslint': tseslint.plugin,
|
|
'unused-imports': unusedImports,
|
|
prettier,
|
|
},
|
|
rules: {
|
|
'no-unused-vars': 'off',
|
|
'prettier/prettier': 'error',
|
|
'unused-imports/no-unused-imports': 'error',
|
|
'no-restricted-imports': [
|
|
'error',
|
|
{
|
|
patterns: [
|
|
{
|
|
regex: '^@opencode-ai/sdk(/.*)?',
|
|
message: 'Use a relative import, not a package import.',
|
|
},
|
|
],
|
|
},
|
|
],
|
|
},
|
|
},
|
|
{
|
|
files: ['tests/**', 'examples/**'],
|
|
rules: {
|
|
'no-restricted-imports': 'off',
|
|
},
|
|
},
|
|
);
|