Skip to content

Commit

Permalink
Merge pull request #56 from dddsw/update-packages
Browse files Browse the repository at this point in the history
Update packages and add precommit hook for linting
  • Loading branch information
dynamictulip authored Oct 18, 2024
2 parents 83df35b + d546850 commit 62cb83a
Show file tree
Hide file tree
Showing 11 changed files with 1,937 additions and 1,123 deletions.
13 changes: 0 additions & 13 deletions .eslintignore

This file was deleted.

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

This file was deleted.

1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npx lint-staged
3 changes: 3 additions & 0 deletions .lintstagedrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"*.*": ["eslint --fix", "prettier --write"]
}
2 changes: 1 addition & 1 deletion .node-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
16.17.0
22
4 changes: 4 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,7 @@ node_modules
pnpm-lock.yaml
package-lock.json
yarn.lock

*.png
.*ignore
.node-version
2 changes: 1 addition & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"bracketSameLine": true,
"useTabs": true,
"singleQuote": true,
"trailingComma": "none",
"printWidth": 100,
"plugins": ["prettier-plugin-svelte"],
"pluginSearchDirs": ["."],
"overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }]
}
47 changes: 47 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import globals from 'globals';
import pluginJs from '@eslint/js';
import tseslint from 'typescript-eslint';
import { includeIgnoreFile } from '@eslint/compat';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import eslintPluginSvelte from 'eslint-plugin-svelte';
import eslintConfigPrettier from 'eslint-config-prettier';
import svelteParser from 'svelte-eslint-parser';

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const gitignorePath = path.resolve(__dirname, '.gitignore');

export default [
includeIgnoreFile(gitignorePath),
pluginJs.configs.recommended,
...tseslint.configs.recommended,
...eslintPluginSvelte.configs['flat/prettier'],
eslintConfigPrettier,
{ files: ['**/*.{js,mjs,cjs,ts}'] },
{
languageOptions: {
globals: {
...globals.browser,
...globals.node
}
}
},
{
files: ['**/*.svelte', '*.svelte'],

languageOptions: {
globals: {
...globals.browser,
...globals.node
},
parser: svelteParser,
parserOptions: {
parser: {
ts: '@typescript-eslint/parser'
},
extraFileExtensions: ['.svelte']
}
}
}
];
Loading

0 comments on commit 62cb83a

Please sign in to comment.