mirror of
https://github.com/clockworklabs/SpacetimeDB.git
synced 2026-05-06 07:26:43 -04:00
58d299ea42
# Description of Changes This PR removes the `@clockworklabs/typescript-sdk` from the repository and retains only `spacetimedb` in the `crates/bindings-typescript` directory. Some files are migrated to `spacetimedb`. I have also updated the appropriate READMEs. In addition I have symlinked the old `sdks/typescript` directory to point to `crates/bindings-typescript`. # API and ABI breaking changes This is not technically a breaking change of any kind, although it does orphan and deprecate the [@clockworklabs/spacetimedb-sdk](https://www.npmjs.com/package/@clockworklabs/spacetimedb-sdk) npm package. This package will no longer work with SpacetimeDB. Users should now install and use the `spacetimedb` package. # Expected complexity level and risk 2, it's a straightforward change but affects many files. # Testing - [ ] I ran `pnpm test` in the `spacetimedb` package - [ ] I ran the quickstart app --------- Co-authored-by: Zeke Foppa <[email protected]>
79 lines
2.4 KiB
JavaScript
79 lines
2.4 KiB
JavaScript
import js from '@eslint/js';
|
|
import globals from 'globals';
|
|
import tseslint from 'typescript-eslint';
|
|
import reactHooks from 'eslint-plugin-react-hooks';
|
|
import reactRefresh from 'eslint-plugin-react-refresh';
|
|
|
|
import { fileURLToPath } from 'node:url';
|
|
import { dirname } from 'node:path';
|
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
|
|
export default tseslint.config(
|
|
{
|
|
ignores: ['**/dist/**', '**/build/**', '**/coverage/**'],
|
|
},
|
|
js.configs.recommended,
|
|
{
|
|
files: ['**/*.{js,cjs,mjs}'],
|
|
languageOptions: {
|
|
ecmaVersion: 'latest',
|
|
sourceType: 'module',
|
|
globals: globals.node,
|
|
parserOptions: {
|
|
project: false,
|
|
tsconfigRootDir: __dirname,
|
|
},
|
|
},
|
|
},
|
|
...tseslint.configs.recommended,
|
|
{
|
|
files: ['**/*.{ts,tsx}'],
|
|
languageOptions: {
|
|
parser: tseslint.parser,
|
|
ecmaVersion: 'latest',
|
|
sourceType: 'module',
|
|
globals: { ...globals.browser, ...globals.node },
|
|
parserOptions: {
|
|
project: [
|
|
'./tsconfig.json',
|
|
'./crates/bindings-typescript/tsconfig.json',
|
|
'./crates/bindings-typescript/test-app/tsconfig.json',
|
|
'./crates/bindings-typescript/examples/quickstart-chat/tsconfig.json',
|
|
'./docs/tsconfig.json',
|
|
],
|
|
projectService: true,
|
|
tsconfigRootDir: __dirname,
|
|
},
|
|
},
|
|
linterOptions: {
|
|
reportUnusedDisableDirectives: "off",
|
|
},
|
|
plugins: {
|
|
'@typescript-eslint': tseslint.plugin,
|
|
'react-hooks': reactHooks,
|
|
'react-refresh': reactRefresh,
|
|
},
|
|
rules: {
|
|
'@typescript-eslint/no-explicit-any': 'off',
|
|
'@typescript-eslint/no-namespace': 'error',
|
|
"@typescript-eslint/no-unused-vars": [
|
|
"error",
|
|
{
|
|
"argsIgnorePattern": "^_",
|
|
"varsIgnorePattern": "^_",
|
|
"destructuredArrayIgnorePattern": "^_",
|
|
"caughtErrorsIgnorePattern": "^_"
|
|
}
|
|
],
|
|
'no-restricted-syntax': [
|
|
'error',
|
|
{ selector: 'TSEnumDeclaration', message: 'Do not use enums; stick to JS-compatible types.' },
|
|
{ selector: 'TSEnumDeclaration[const=true]', message: 'Do not use const enum; use unions or objects.' },
|
|
{ selector: 'Decorator', message: 'Do not use decorators.' },
|
|
],
|
|
...reactHooks.configs.recommended.rules,
|
|
'react-refresh/only-export-components': ['warn', { allowConstantExport: true }],
|
|
"eslint-comments/no-unused-disable": "off",
|
|
},
|
|
}
|
|
); |