diff --git a/.gitignore b/.gitignore index b46e1b5..c01143a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ node_modules/ dist/ *.sw? +.lvimrc diff --git a/bun.lockb b/bun.lockb new file mode 100755 index 0000000..2a53d04 Binary files /dev/null and b/bun.lockb differ diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 0000000..0d3cf6b --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,54 @@ +import importPlugin from 'eslint-plugin-import' +import tsParser from '@typescript-eslint/parser' +import eslintJs from '@eslint/js' +import eslintTs from 'typescript-eslint' + +const tsFiles = ['src/**/*.ts'] + +const customTypescriptConfig = { + files: tsFiles, + plugins: { + import: importPlugin, + 'import/parsers': tsParser, + }, + languageOptions: { + parser: tsParser, + parserOptions: { + project: './tsconfig.json', + }, + }, + settings: { + 'import/parsers': { + '@typescript-eslint/parser': ['.ts'], + }, + }, + rules: { + 'linebreak-style': ['error', 'unix'], + quotes: ['error', 'single', { avoidEscape: true }], + }, +} + +const recommendedTypeScriptConfigs = [ + ...eslintTs.configs.recommended.map((config) => ({ + ...config, + files: tsFiles, + })), + ...eslintTs.configs.stylistic.map((config) => ({ + ...config, + files: tsFiles, + })), +] + +export default [ + { + ignores: [ + 'docs/*', + 'build/*', + 'lib/*', + 'dist/*', + ], + }, // global ignores + eslintJs.configs.recommended, + ...recommendedTypeScriptConfigs, + customTypescriptConfig, +] diff --git a/package-lock.json b/package-lock.json deleted file mode 100644 index c41a9de..0000000 --- a/package-lock.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "name": "@jdbernard/logging", - "version": "1.1.5", - "lockfileVersion": 3, - "requires": true, - "packages": { - "": { - "name": "@jdbernard/logging", - "version": "1.1.4", - "license": "GPL-3.0", - "devDependencies": { - "typescript": "^5.0.4" - } - }, - "node_modules/typescript": { - "version": "5.0.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.0.4.tgz", - "integrity": "sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw==", - "dev": true, - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" - }, - "engines": { - "node": ">=12.20" - } - } - } -} diff --git a/package.json b/package.json index 81082fa..a9d9f19 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ ], "scripts": { "build": "tsc", - "prepare": "npm run build", + "prepare": "bun run build", "test": "echo \"Error: no test specified\" && exit 1" }, "repository": { @@ -23,6 +23,9 @@ "author": "Jonathan Bernard", "license": "GPL-3.0", "devDependencies": { - "typescript": "^5.0.4" + "@typescript-eslint/parser": "^8.19.0", + "eslint-plugin-import": "^2.31.0", + "typescript": "^5.0.4", + "typescript-eslint": "^8.19.0" } } diff --git a/tsconfig.json b/tsconfig.json index c2fe667..68a7856 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,7 +1,7 @@ { "compilerOptions": { "module": "commonjs", - "target": "es6", + "target": "es2016", "declaration": true, "outDir": "./dist", "strict": true,