diff --git a/src/index.ts b/src/index.ts index e8a7e5c..613961f 100644 --- a/src/index.ts +++ b/src/index.ts @@ -5,12 +5,12 @@ * @license GPL-3.0-or-later */ -import './lib/featureCheck'; // warn user of missing feature support first -import './components/mainMenu'; -import './components/digest'; -import './components/prng'; -import './components/encryption'; -import './components/passwords'; -import './lib/form'; -import './lib/operationAreas'; -import './lib/tabs'; +import '@/lib/featureCheck'; // warn user of missing feature support first +import '@/components/mainMenu'; +import '@/components/digest'; +import '@/components/prng'; +import '@/components/encryption'; +import '@/components/passwords'; +import '@/lib/form'; +import '@/lib/operationAreas'; +import '@/lib/tabs'; diff --git a/src/package.json b/src/package.json index 73cb060..4cb4f0d 100644 --- a/src/package.json +++ b/src/package.json @@ -7,7 +7,8 @@ "scripts": { "start": "node esbuild.mjs --watch", "build": "node esbuild.mjs", - "lint": "cd .. && npx eslint src" + "lint": "cd .. && npx eslint src", + "format": "cd .. && npx prettier --write src && npx eslint src --fix" }, "author": "Micah Henning ", "license": "GPL-3.0-or-later", diff --git a/src/prettier.config.cjs b/src/prettier.config.cjs new file mode 100644 index 0000000..529c631 --- /dev/null +++ b/src/prettier.config.cjs @@ -0,0 +1,33 @@ +const overrides = [ + { + files: ['*.yml', '*.yaml'], + options: { + tabWidth: 2, + }, + }, + { + files: 'tsconfig.json', + options: { + parser: 'json', + }, + }, +]; + +module.exports = { + arrowParens: 'avoid', + bracketSameLine: true, + bracketSpacing: true, + htmlWhitespaceSensitivity: 'css', + insertPragma: false, + jsxSingleQuote: false, + overrides, + printWidth: 160, + proseWrap: 'preserve', + quoteProps: 'as-needed', + requirePragma: false, + semi: true, + singleQuote: true, + tabWidth: 2, + trailingComma: 'all', + useTabs: false, +}; diff --git a/src/tsconfig.json b/src/tsconfig.json index cf377d5..016fa38 100644 --- a/src/tsconfig.json +++ b/src/tsconfig.json @@ -1,6 +1,6 @@ { "compilerOptions": { - "module": "commonjs", + "module": "ESNext", "strict": true, "noImplicitReturns": true, "removeComments": true, @@ -13,7 +13,8 @@ "rootDir": "./", "baseUrl": ".", "paths": { - "*": ["types/*"] + "*": ["types/*"], + "@/*": ["./*"] } }, "include": [