Skip to content

Commit

Permalink
Dx 1102 (#1213)
Browse files Browse the repository at this point in the history
* feat: add new linter

* chore: format files

* chore: add linted files

* fix: copy readme & package.json & license to dist after build

otherwise, we get MissingPackageJSON error when installing upstash/redis in our CI tests https://github.com/upstash/redis-js/actions/runs/10091669210/job/27903832137

installing with npm instead of bun solves the issue but we get another error when running: https://github.com/upstash/redis-js/actions/runs/10091973099/job/27904892427

* fix: remove flaky tests

---------

Co-authored-by: CahidArda <[email protected]>
  • Loading branch information
ogzhanolguncu and CahidArda authored Jul 25, 2024
1 parent 42ebc46 commit 26a3a66
Show file tree
Hide file tree
Showing 240 changed files with 1,252 additions and 1,010 deletions.
44 changes: 44 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"env": {
"es2024": true
},
"extends": [
"eslint:recommended",
"plugin:unicorn/recommended",
"plugin:@typescript-eslint/recommended"
],
"plugins": ["@typescript-eslint", "unicorn"],
"parserOptions": {
"project": "./tsconfig.json"
},
"ignorePatterns": ["*.config.*", "examples", "dist"],
"rules": {
"no-console": ["error", { "allow": ["warn", "error"] }],
"@typescript-eslint/no-magic-numbers": "off",
"@typescript-eslint/unbound-method": "off",
"@typescript-eslint/prefer-as-const": "error",
"@typescript-eslint/consistent-type-imports": "error",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/restrict-template-expressions": "off",
"@typescript-eslint/consistent-type-definitions": ["error", "type"],
"@typescript-eslint/no-unused-vars": [
"error",
{ "varsIgnorePattern": "^_", "argsIgnorePattern": "^_" }
],
"@typescript-eslint/prefer-ts-expect-error": "off",
"@typescript-eslint/no-misused-promises": [
"error",
{
"checksVoidReturn": false
}
],
"unicorn/prevent-abbreviations": "off",
"no-implicit-coercion": ["error", { "boolean": true }],
"no-extra-boolean-cast": ["error", { "enforceForLogicalOperands": true }],
"no-unneeded-ternary": ["error", { "defaultAssignment": true }],
"unicorn/no-array-reduce": ["off"],
"unicorn/no-nested-ternary": "off",
"unicorn/no-null": "off",
"unicorn/filename-case": "off"
}
}
184 changes: 169 additions & 15 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,21 +1,175 @@
.vscode/
npm/
node_modules/
# Based on https://raw.githubusercontent.com/github/gitignore/main/Node.gitignore

# Logs

logs
_.log
npm-debug.log_
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# Caches

.cache

# Diagnostic reports (https://nodejs.org/api/report.html)

report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json

# Runtime data

pids
_.pid
_.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover

lib-cov

# Coverage directory used by tools like istanbul

coverage
.env*
!.env.example
.pnpm-debug.log
dist/
.idea/
.next/
*.lcov

# nyc test coverage

.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)

.grunt

# Bower dependency directory (https://bower.io/)

bower_components

# node-waf configuration

.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)

build/Release

# Dependency directories

node_modules/
jspm_packages/

# Snowpack dependency directory (https://snowpack.dev/)

web_modules/

# TypeScript cache

*.tsbuildinfo

# Optional npm cache directory

.npm

# Optional eslint cache

.eslintcache

# Optional stylelint cache

.stylelintcache

# Microbundle cache

.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history

.node_repl_history

# Output of 'npm pack'

*.tgz

# Yarn Integrity file

.yarn-integrity

# dotenv environment variable files

.env
.env.development.local
.env.test.local
.env.production.local
.env.local

# parcel-bundler cache (https://parceljs.org/)

.parcel-cache

# Next.js build output

.next
out

# Nuxt.js build / generate output

.nuxt
dist

# Gatsby files

# Comment in the public line in if your project uses Gatsby and not Next.js

# https://nextjs.org/blog/next-9-1#public-directory-support

# public

# vuepress build output

.vuepress/dist

# vuepress v2.x temp and cache directory

.temp

# Docusaurus cache and generated files

.docusaurus

# Serverless directories

.serverless/

# FuseBox cache

.fusebox/

# DynamoDB Local files

.dynamodb/

# TernJS port file

.tern-port

# Stores VSCode versions used for testing VSCode extensions

examples/**/yarn.lock
examples/**/package-lock.json
examples/**/pnpm-lock.yaml
.vscode-test

# yarn v2

.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*

# IntelliJ based IDEs
.idea

# Local Netlify folder
.netlify
x/
# Finder (MacOS) folder config
.DS_Store
1 change: 1 addition & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bun --no -- commitlint --edit ""
2 changes: 0 additions & 2 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

bun run fmt && bun run test
1 change: 1 addition & 0 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bun run build
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
**/examples
14 changes: 0 additions & 14 deletions .releaserc

This file was deleted.

3 changes: 3 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"recommendations": ["dbaeumer.vscode-eslint", "esbenp.prettier-vscode"]
}
20 changes: 20 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"editor.formatOnSave": true,
"git.autofetch": true,
"editor.codeActionsOnSave": {
"source.fixAll": "explicit"
},
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[jsonc]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ bun run test
bun run build
```


### Telemetry

This library sends anonymous telemetry data to help us improve your experience.
Expand Down
34 changes: 0 additions & 34 deletions biome.json

This file was deleted.

Binary file modified bun.lockb
Binary file not shown.
46 changes: 46 additions & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
// build: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
// ci: Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)
// docs: Documentation only changes
// feat: A new feature
// fix: A bug fix
// perf: A code change that improves performance
// refactor: A code change that neither fixes a bug nor adds a feature
// style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
// test: Adding missing tests or correcting existing tests

module.exports = {
extends: ["@commitlint/config-conventional"],
rules: {
"body-leading-blank": [1, "always"],
"body-max-line-length": [2, "always", 100],
"footer-leading-blank": [1, "always"],
"footer-max-line-length": [2, "always", 100],
"header-max-length": [2, "always", 100],
"scope-case": [2, "always", "lower-case"],
"subject-case": [2, "never", ["sentence-case", "start-case", "pascal-case", "upper-case"]],
"subject-empty": [2, "never"],
"subject-full-stop": [2, "never", "."],
"type-case": [2, "always", "lower-case"],
"type-empty": [2, "never"],
"type-enum": [
2,
"always",
[
"build",
"chore",
"ci",
"docs",
"feat",
"fix",
"perf",
"refactor",
"revert",
"style",
"test",
"translation",
"security",
"changeset",
],
],
},
};
1 change: 0 additions & 1 deletion index.ts

This file was deleted.

Loading

0 comments on commit 26a3a66

Please sign in to comment.