Skip to content

Commit

Permalink
Merge pull request #202 from oddbird/dependabot/npm_and_yarn/dev-mino…
Browse files Browse the repository at this point in the history
…r-0b8528a078

Bump the dev-minor group with 9 updates
  • Loading branch information
jgerigmeyer authored Oct 7, 2024
2 parents b215c83 + 27ffbf4 commit c90da95
Show file tree
Hide file tree
Showing 34 changed files with 707 additions and 1,316 deletions.
15 changes: 0 additions & 15 deletions .eslintignore

This file was deleted.

56 changes: 0 additions & 56 deletions .eslintrc.cjs

This file was deleted.

1 change: 0 additions & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,5 @@ updates:
- 'patch'
ignore:
- dependency-name: '@types/node'
- dependency-name: 'eslint'
update-types:
- 'version-update:semver-major'
4 changes: 2 additions & 2 deletions .svelte-kit/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
"../src/*"
],
"$test": [
"../test/js"
"../test"
],
"$test/*": [
"../test/js/*"
"../test/*"
],
"$lib": [
"../src/lib"
Expand Down
46 changes: 14 additions & 32 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,47 +1,34 @@
{
"editor.bracketPairColorization.enabled": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
"source.fixAll": "explicit"
},
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"editor.insertSpaces": true,
"editor.rulers": [80],
"editor.tabSize": 2,
"eslint.validate": [
"javascript",
"typescript",
"svelte"
],
"eslint.options": {
"extensions": [".js", ".cjs", ".svelte", ".ts", ".cts"]
},
"eslint.useFlatConfig": true,
"eslint.validate": ["javascript", "typescript", "svelte"],
"eslint.workingDirectories": [{ "mode": "auto" }],
"files.eol": "\n",
"files.insertFinalNewline": true,
"files.trimFinalNewlines": true,
"files.trimTrailingWhitespace": true,
"javascript.suggestionActions.enabled": false,
"prettier.documentSelectors": ["**/*.svg"],
"scss.lint.unknownAtRules": "ignore",
"scss.validate": false,
"stylelint.validate": ["scss"],
"svelte.enable-ts-plugin": true,
"typescript.preferences.quoteStyle": "single",
"typescript.tsdk": "node_modules/typescript/lib",
"[javascript]": {
"editor.rulers": [80]
},
"[restructuredtext]": {
"editor.rulers": [80]
},
"[markdown]": {
"editor.rulers": [80]
"[html]": {
"editor.formatOnSave": false
},
"[svelte]": {
"editor.defaultFormatter": "svelte.svelte-vscode",
"editor.rulers": [80]
},
"[typescript]": {
"editor.rulers": [80]
},
"[html]": {
"editor.formatOnSave": false
},
"[scss]": {
"editor.rulers": [80],
"editor.codeActionsOnSave": {
"source.fixAll.stylelint": "explicit"
}
Expand All @@ -51,7 +38,6 @@
"**/.DS_Store": true,
".coverage": true,
"coverage": true,
"htmlcov": true,
".tags": true,
".cache": true,
"collected-assets": true,
Expand All @@ -64,10 +50,6 @@
"**/*.js.map": true,
"yarn.lock": true,
"yarn-debug.log": true,
"yarn-error.log": true,
".svelte-kit": true,
"static/built": true,
"static/docs": true,
".yarn": true
"yarn-error.log": true
}
}
107 changes: 107 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
/* eslint-disable @typescript-eslint/no-unsafe-member-access, import/no-named-as-default-member */

import js from '@eslint/js';
import tsParser from '@typescript-eslint/parser';
import vitest from '@vitest/eslint-plugin';
import prettier from 'eslint-config-prettier';
// @ts-expect-error no types
import importPlugin from 'eslint-plugin-import';
import simpleImportSort from 'eslint-plugin-simple-import-sort';
import svelte from 'eslint-plugin-svelte';
import globals from 'globals';
import svelteParser from 'svelte-eslint-parser';
import tseslint from 'typescript-eslint';

import svelteConfig from './svelte.config.js';

export default [
{
ignores: [
'.git/*',
'.svelte-kit/*',
'.vscode/*',
'.yarn/*',
'.yarnrc.yml',
'build/*',
'coverage/*',
'node_modules/*',
'package/*',
'src/js/api/client/*',
'static/built/*',
'static/styleguide/*',
'yarn.lock',
],
},
js.configs.recommended,
...tseslint.configs.recommendedTypeChecked,
...tseslint.configs.stylisticTypeChecked,
importPlugin.flatConfigs.recommended,
importPlugin.flatConfigs.typescript,
...svelte.configs['flat/recommended'],
...svelte.configs['flat/prettier'],
prettier,
{
files: ['**/*.{js,mjs,cjs,svelte,ts,cts,mts}'],
languageOptions: {
globals: {
...globals.node,
...globals.es2021,
},
parserOptions: {
project: ['tsconfig.json', 'test/tsconfig.json'],
extraFileExtensions: ['.svelte'],
},
},
plugins: { 'simple-import-sort': simpleImportSort },
settings: {
'import/resolver': {
typescript: {
project: ['tsconfig.json', 'test/tsconfig.json'],
},
},
},
rules: {
'no-warning-comments': ['warn', { terms: ['todo', 'fixme', '@@@'] }],
'simple-import-sort/imports': 'warn',
'simple-import-sort/exports': 'warn',
'import/first': 'warn',
'import/newline-after-import': 'warn',
'import/no-duplicates': ['error', { 'prefer-inline': true }],
'import/order': 'off',
},
},
{
files: ['**/*.svelte', '*.svelte'],
languageOptions: {
parser: svelteParser,
parserOptions: {
parser: tsParser,
svelteConfig,
},
},
},
{
files: ['src/**/*.{js,mjs,cjs,svelte,ts,cts,mts}'],
languageOptions: {
globals: {
...globals.browser,
...globals.es2021,
},
},
},
{
files: ['test/**/*.spec.{js,ts}'],
languageOptions: {
globals: {
...vitest.environments.env.globals,
},
},
plugins: {
vitest,
},
rules: {
...vitest.configs.recommended.rules,
'@typescript-eslint/unbound-method': 'off',
},
},
];
40 changes: 20 additions & 20 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,55 +30,55 @@
"docs:compile": "sassdoc 'src/sass/**/*.scss'",
"docs": "run-s docs:sass docs:json docs:compile",
"watch:docs": "chokidar \"src/sass/**/*.scss\" \"./.sassdocrc\" \"./README.md\" -c \"yarn docs\"",
"test": "run-s test:js test:sass",
"test:js": "vitest",
"test:js:watch": "yarn test:js --watch",
"test:sass": "mocha --loader=ts-node/esm --extension ts test/sass"
"test": "vitest",
"test:watch": "yarn test --watch"
},
"dependencies": {
"accoutrement": "^4.0.4",
"colorjs.io": "^0.5.2"
},
"devDependencies": {
"@eslint/js": "^9.12.0",
"@sveltejs/adapter-auto": "^3.2.5",
"@sveltejs/kit": "^2.6.1",
"@sveltejs/kit": "^2.6.2",
"@sveltejs/vite-plugin-svelte": "^3.1.2",
"@testing-library/jest-dom": "^6.5.0",
"@testing-library/svelte": "^5.2.1",
"@types/jest": "^29.5.13",
"@types/lodash": "^4.17.9",
"@types/node": "*",
"@typescript-eslint/eslint-plugin": "^8.7.0",
"@typescript-eslint/parser": "^8.7.0",
"@vitest/coverage-v8": "^2.1.1",
"@testing-library/svelte": "^5.2.3",
"@types/eslint-config-prettier": "^6.11.3",
"@types/eslint__js": "^8.42.3",
"@types/lodash": "^4.17.10",
"@types/node": "^20",
"@typescript-eslint/eslint-plugin": "^8.8.0",
"@typescript-eslint/parser": "^8.8.0",
"@typescript-eslint/utils": "^8.8.0",
"@vitest/coverage-v8": "^2.1.2",
"@vitest/eslint-plugin": "^1.1.7",
"chokidar-cli": "^3.0.0",
"eslint": "^8.57.1",
"eslint": "^9.12.0",
"eslint-config-prettier": "^9.1.0",
"eslint-import-resolver-typescript": "^3.6.3",
"eslint-plugin-import": "^2.30.0",
"eslint-plugin-jest": "^28.8.3",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-simple-import-sort": "^12.1.1",
"eslint-plugin-svelte": "^2.44.1",
"jsdom": "^25.0.1",
"lodash": "^4.17.21",
"mocha": "^10.7.3",
"mockdate": "^3.0.5",
"npm-run-all": "^4.1.5",
"postcss": "^8.4.47",
"prettier": "^3.3.3",
"prettier-plugin-svelte": "^3.2.7",
"sass-embedded": "^1.79.4",
"sass-true": "^8.0.0",
"sassdoc": "^2.7.4",
"sassdoc-theme-herman": "^6.0.1",
"stylelint": "^16.9.0",
"stylelint-config-standard-scss": "^13.1.0",
"svelte": "^4.2.19",
"svelte-check": "^4.0.4",
"ts-node": "^10.9.2",
"svelte-eslint-parser": "^0.41.1",
"typescript": "^5.6.2",
"typescript-eslint": "^8.8.0",
"vite": "^5.4.8",
"vitest": "^2.1.1"
"vitest": "^2.1.2"
},
"packageManager": "yarn@4.4.1"
"packageManager": "yarn@4.5.0"
}
8 changes: 4 additions & 4 deletions src/lib/components/colors/Formats.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
import type { PlainColorObject } from 'colorjs.io/fn';
import FormatGroup from '$lib/components/colors/FormatGroup.svelte';
import type {
ColorFormatId,
FormatGroup as FormatGroupType,
import {
type ColorFormatId,
FORMAT_GROUPS,
type FormatGroup as FormatGroupType,
} from '$lib/constants';
import { FORMAT_GROUPS } from '$lib/constants';
export let type: 'bg' | 'fg';
export let color: PlainColorObject;
Expand Down
5 changes: 2 additions & 3 deletions src/lib/components/colors/Sliders.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
import type { PlainColorObject } from 'colorjs.io/fn';
import type { Writable } from 'svelte/store';
import type { ColorFormatId } from '$lib/constants';
import { SLIDERS } from '$lib/constants';
import { type ColorFormatId, SLIDERS } from '$lib/constants';
import { ColorSpace } from '$lib/stores';
import { getSpaceFromFormatId, sliderGradient } from '$lib/utils';
Expand All @@ -15,7 +14,7 @@
$: spaceObject = ColorSpace.get(targetSpace);
$: sliders = SLIDERS[format].map((id) => {
const coord = spaceObject.coords[id];
const range = coord?.range || coord?.refRange || [0, 1];
const range = coord?.range ?? coord?.refRange ?? [0, 1];
const gradient = sliderGradient($color, id, range);
return {
id,
Expand Down
Loading

0 comments on commit c90da95

Please sign in to comment.