Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

initial #52

Closed
wants to merge 2 commits into from
Closed
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
14 changes: 5 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,19 @@
},
"packageManager": "[email protected]+sha256.06e65a4965baff6d6097f9c8f75c35f6d420974dbc03d775009056a69edfd271",
"devDependencies": {
"@eslint/eslintrc": "^3.2.0",
"@eslint/js": "^9.19.0",
"@types/eslint__eslintrc": "^2.1.2",
"@types/node": "^22.10.1",
"@types/semver": "^7.5.8",
"@typescript-eslint/eslint-plugin": "^8.17.0",
"@typescript-eslint/parser": "^8.17.0",
"@typescript-eslint/parser": "^8.22.0",
"@viamrobotics/eslint-config": "workspace:*",
"@viamrobotics/prettier-config": "workspace:*",
"@viamrobotics/typescript-config": "workspace:*",
"concurrently": "^9.1.0",
"eslint": "^8.57.1",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-jest-dom": "^5.5.0",
"eslint-plugin-simple-import-sort": "^12.1.1",
"eslint-plugin-svelte": "^2.46.1",
"eslint-plugin-tailwindcss": "^3.17.5",
"eslint-plugin-testing-library": "^7.0.0",
"eslint-plugin-unicorn": "^56.0.1",
"eslint-plugin-vitest": "^0.5.4",
Comment on lines -29 to -36
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably didn't need to delete these, probably just need to bump them.

"globals": "^15.14.0",
"prettier": "^3.4.1",
"semver": "^7.6.3",
"svelte": "^5.4.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-config-svelte/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ This module contains [Viam][]'s shared [ESLint][] configurations for ESLint v8 i

## Base config

Extend the [config](./eslint-config-svelte.js) in `.eslintrc.cjs`.
Extend the [config](./eslint-config-svelte.mjs) in `.eslintrc.cjs`.

```shell
pnpm add --save-dev \
Expand Down
66 changes: 0 additions & 66 deletions packages/eslint-config-svelte/eslint-config-svelte.js

This file was deleted.

103 changes: 103 additions & 0 deletions packages/eslint-config-svelte/eslint-config-svelte.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
import parser from 'svelte-eslint-parser';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import js from '@eslint/js';
import { FlatCompat } from '@eslint/eslintrc';

import { EXTENDS, CJS, TESTS } from '@viamrobotics/eslint-config';

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all,
});

export default [
...compat.extends(
...EXTENDS,
'plugin:tailwindcss/recommended',
'plugin:svelte/recommended',
'plugin:svelte/prettier'
),
{
languageOptions: {
sourceType: 'module',
ecmaVersion: 'latest',
parserOptions: {
extraFileExtensions: ['.svelte'],
},
},

settings: {
svelte: {
ignoreWarnings: [
'@typescript-eslint/no-unsafe-assignment',
'@typescript-eslint/no-unsafe-member-access',
],
},

tailwindcss: {
callees: ['classnames', 'cx'],
classRegex: '^(?:class|cx)$',
},
},
},
CJS,
TESTS,
{
files: ['**/*.svelte'],

languageOptions: {
parser: parser,
ecmaVersion: 5,
sourceType: 'script',

parserOptions: {
parser: '@typescript-eslint/parser',
},
},

rules: {
'svelte/valid-compile': 'off',
'no-undef-init': 'off',
},
},
...compat
.extends('plugin:jest-dom/recommended', 'plugin:testing-library/dom')
.map((config) => ({
...config,
files: ['**/__tests__/**', '**/*.test.ts', '**/*.spec.ts'],
})),
{
files: ['**/__tests__/**', '**/*.test.ts', '**/*.spec.ts'],

rules: {
'testing-library/await-async-events': [
'error',
{
eventModule: ['fireEvent', 'userEvent'],
},
],

'testing-library/no-await-sync-events': 'off',

'testing-library/no-node-access': [
'error',
{
allowContainerFirstChild: true,
},
],

'testing-library/prefer-explicit-assert': [
'error',
{
assertion: 'toBeInTheDocument',
},
],

'testing-library/prefer-user-event': 'error',
},
},
];
8 changes: 4 additions & 4 deletions packages/eslint-config-svelte/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
"version": "0.8.0",
"description": "ESLint configuration for Svelte projects at Viam.",
"type": "commonjs",
"main": "./eslint-config-svelte.js",
"types": "./dist/eslint-config-svelte.d.ts",
"main": "./eslint-config-svelte.mjs",
"types": "./dist/eslint-config-svelte.d.mts",
"exports": {
".": {
"types": "./dist/eslint-config-svelte.d.ts",
"default": "./eslint-config-svelte.js"
"types": "./dist/eslint-config-svelte.d.mts",
"default": "./eslint-config-svelte.mjs"
}
},
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-config-svelte/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
"outDir": "dist"
},
"references": [{ "path": "../eslint-config" }],
"include": ["*.js"]
"include": ["*.js", "eslint-config-svelte.mjs"]
}
2 changes: 1 addition & 1 deletion packages/eslint-config/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ This module contains [Viam][]'s shared [ESLint][] configurations for ESLint v8.

## Base config

Extend the [config](./eslint-config.js) in `.eslintrc.cjs`.
Extend the [config](./eslint-config.mjs) in `.eslintrc.cjs`.

```shell
pnpm add --save-dev \
Expand Down
Loading
Loading