Skip to content

Commit

Permalink
🎉 init: Initialize project
Browse files Browse the repository at this point in the history
  • Loading branch information
Snowflyt committed Nov 3, 2024
0 parents commit 92961e0
Show file tree
Hide file tree
Showing 28 changed files with 14,224 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# EditorConfig is awesome: https://EditorConfig.org

# top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true

# Matches multiple files with brace expansion notation
# Set default charset
[*.{js,cjs,mjs,ts,cts,mts,json}]
charset = utf-8
indent_style = space
indent_size = 2
70 changes: 70 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
// @ts-check

/* eslint-env node */

/** @satisfies {import("eslint").Linter.Config} */
const config = {
root: true,
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"plugin:import/recommended",
"plugin:import/typescript",
"plugin:prettier/recommended",
"plugin:sonarjs/recommended",
],
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaVersion: "latest",
sourceType: "module",
project: ["./tsconfig.json", "./tsconfig.eslint.json"],
tsconfigRootDir: __dirname,
},
ignorePatterns: ["!.lintstagedrc.js"],
plugins: ["sort-destructure-keys"],
rules: {
"@typescript-eslint/consistent-type-imports": [
"error",
{ prefer: "type-imports", disallowTypeAnnotations: false },
],
"@typescript-eslint/no-empty-object-type": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-namespace": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-unsafe-argument": "off",
"@typescript-eslint/no-unsafe-assignment": "off",
"@typescript-eslint/no-unsafe-call": "off",
"@typescript-eslint/no-unsafe-member-access": "off",
"@typescript-eslint/no-unsafe-return": "off",
"@typescript-eslint/no-unused-vars": "off", // Already covered by TypeScript
"import/export": "off",
"import/consistent-type-specifier-style": ["error", "prefer-top-level"],
"import/namespace": "off",
"import/no-unresolved": "off",
"import/order": [
"error",
{
alphabetize: { order: "asc" },
groups: ["builtin", "external", "internal", "parent", "sibling", "index", "object", "type"],
"newlines-between": "always",
},
],
"no-undef": "off",
"sonarjs/cognitive-complexity": "off",
"sonarjs/no-duplicate-string": "off",
"sort-destructure-keys/sort-destructure-keys": "error",
"sort-imports": [
"error",
{
ignoreCase: false,
ignoreDeclarationSort: true,
ignoreMemberSort: false,
memberSyntaxSortOrder: ["none", "all", "multiple", "single"],
},
],
},
reportUnusedDisableDirectives: true,
};

module.exports = config;
24 changes: 24 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Logs
logs/
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

# Build
node_modules/
dist/
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea/
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
1 change: 1 addition & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npx --no -- commitlint --edit "${1}"
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
npm run test-types
npm test

npx lint-staged
13 changes: 13 additions & 0 deletions .lintstagedrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// @ts-check

/** @satisfies {import("lint-staged").Config} */
const config = {
"**/*.{js,ts}":
"eslint --fix --no-error-on-unmatched-pattern --report-unused-disable-directives-severity error --max-warnings 0",
"*.{cjs,mjs,cts,mts}":
"eslint --fix --no-error-on-unmatched-pattern --report-unused-disable-directives-severity error --max-warnings 0",
"**/*.{json,md}": "prettier --log-level=silent --no-error-on-unmatched-pattern --write",
".hintrc": "prettier --log-level=silent --no-error-on-unmatched-pattern --write --parser json",
};

export default config;
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 Snowflyt

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Loading

0 comments on commit 92961e0

Please sign in to comment.