-
-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
4,923 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# top-most EditorConfig file | ||
root = true | ||
|
||
[*] | ||
end_of_line = lf | ||
insert_final_newline = true | ||
charset = utf-8 | ||
indent_style = tab | ||
indent_size = 4 | ||
|
||
# tab indentation by default | ||
[*.{js,jsx,ts,tsx}] | ||
indent_style = tab | ||
indent_size = 4 | ||
|
||
# space indentation for some specific files | ||
[package.json] | ||
indent_style = space | ||
indent_size = 2 | ||
|
||
[io-package.json] | ||
indent_style = space | ||
indent_size = 4 | ||
|
||
[*.{yml,yaml,md}] | ||
indent_style = space | ||
indent_size = 2 | ||
|
||
[config/**/*.json] | ||
indent_style = tab | ||
indent_size = 4 | ||
|
||
# Indent code blocks in the documentation with 4-size tabs | ||
[docs/**/*.md] | ||
indent_style = tab | ||
indent_size = 4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
build/ | ||
node_modules/ | ||
**/node_modules/ | ||
.* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,141 @@ | ||
/* | ||
Note to future self: | ||
If ESLint is ever extremely slow again, check if there are .js and/or .map files in the source directories | ||
and delete them: | ||
```bash | ||
find . -type f -name "*.map" | grep ./packages | grep /src/ | xargs -n1 rm | ||
find . -type f -name "*.js" | grep ./packages | grep /src/ | xargs -n1 rm | ||
``` | ||
Running `TIMING=1 DEBUG=eslint:cli-engine yarn run lint:ts` helps detect the problem | ||
*/ | ||
|
||
module.exports = { | ||
parser: "@typescript-eslint/parser", // Specifies the ESLint parser | ||
parserOptions: { | ||
ecmaVersion: 2021, // Allows for the parsing of modern ECMAScript features | ||
sourceType: "module", // Allows for the use of imports | ||
project: "./tsconfig.json", | ||
}, | ||
extends: [ | ||
// Use the recommended rules from the @typescript-eslint/eslint-plugin | ||
"plugin:@typescript-eslint/recommended", | ||
"plugin:@typescript-eslint/recommended-requiring-type-checking", | ||
// Enables eslint-plugin-prettier and displays prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array. | ||
"plugin:prettier/recommended", | ||
], | ||
plugins: [], | ||
reportUnusedDisableDirectives: true, | ||
rules: { | ||
// Place to specify ESLint rules. Can be used to overwrite rules specified from the extended configs | ||
"@typescript-eslint/no-parameter-properties": "off", | ||
"@typescript-eslint/no-explicit-any": "off", | ||
"@typescript-eslint/no-use-before-define": [ | ||
"error", | ||
{ | ||
functions: false, | ||
typedefs: false, | ||
classes: false, | ||
}, | ||
], | ||
"@typescript-eslint/no-unused-vars": [ | ||
"error", | ||
{ | ||
ignoreRestSiblings: true, | ||
argsIgnorePattern: "^_", | ||
}, | ||
], | ||
"@typescript-eslint/no-object-literal-type-assertion": "off", | ||
"@typescript-eslint/interface-name-prefix": "off", | ||
"@typescript-eslint/no-non-null-assertion": "off", // This is necessary for Map.has()/get()! | ||
"@typescript-eslint/no-inferrable-types": [ | ||
"error", | ||
{ | ||
ignoreProperties: true, | ||
ignoreParameters: true, | ||
}, | ||
], | ||
"@typescript-eslint/ban-ts-comment": [ | ||
"error", | ||
{ | ||
"ts-expect-error": false, | ||
"ts-ignore": true, | ||
"ts-nocheck": true, | ||
"ts-check": false, | ||
}, | ||
], | ||
"@typescript-eslint/restrict-template-expressions": [ | ||
"error", | ||
{ | ||
allowNumber: true, | ||
allowBoolean: true, | ||
// This is necessary to log errors | ||
// TODO: Consider switching to false when we may annotate catch clauses | ||
allowAny: true, | ||
allowNullish: true, | ||
}, | ||
], | ||
"@typescript-eslint/no-misused-promises": [ | ||
"error", | ||
{ | ||
checksVoidReturn: false, | ||
}, | ||
], | ||
// We can turn this on from time to time but in general these rules | ||
// make our lives harder instead of easier | ||
"@typescript-eslint/no-unsafe-argument": "off", | ||
"@typescript-eslint/no-unsafe-assignment": "off", | ||
"@typescript-eslint/no-unsafe-member-access": "off", | ||
"@typescript-eslint/no-unsafe-return": "off", | ||
"@typescript-eslint/no-unsafe-call": "off", | ||
|
||
// Although this rule makes sense, it takes about a second to execute (and we don't need it) | ||
"@typescript-eslint/no-implied-eval": "off", | ||
|
||
"@typescript-eslint/explicit-module-boundary-types": [ | ||
"warn", | ||
{ allowArgumentsExplicitlyTypedAsAny: true }, | ||
], | ||
"@typescript-eslint/no-this-alias": "off", | ||
|
||
// Prefer simple property access and declaration without quotes | ||
"dot-notation": "off", | ||
"@typescript-eslint/dot-notation": [ | ||
"error", | ||
{ | ||
allowPrivateClassPropertyAccess: true, | ||
allowProtectedClassPropertyAccess: true, | ||
}, | ||
], | ||
"quote-props": ["error", "as-needed"], | ||
}, | ||
overrides: [ | ||
{ | ||
files: ["*.test.ts"], | ||
rules: { | ||
"@typescript-eslint/explicit-function-return-type": "off", | ||
"@typescript-eslint/no-empty-function": "off", | ||
"@typescript-eslint/ban-ts-comment": "off", | ||
"@typescript-eslint/no-unsafe-argument": "off", | ||
"@typescript-eslint/no-unsafe-assignment": "off", | ||
"@typescript-eslint/no-unsafe-member-access": "off", | ||
"@typescript-eslint/no-unsafe-member-return": "off", | ||
"@typescript-eslint/no-unsafe-return": "off", | ||
"@typescript-eslint/no-unsafe-call": "off", | ||
"@typescript-eslint/no-floating-promises": "off", | ||
"@typescript-eslint/require-await": "off", | ||
"@typescript-eslint/unbound-method": "off", | ||
"@typescript-eslint/no-unused-vars": "warn", | ||
"@typescript-eslint/dot-notation": "off", | ||
}, | ||
}, | ||
{ | ||
files: ["*.js"], | ||
rules: { | ||
"@typescript-eslint/*": "off", | ||
}, | ||
}, | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
node_modules/ | ||
|
||
# Yarn config and stuff - we're not using Zero-Installs | ||
# because that would blow up the repo size even more | ||
.yarn/* | ||
!.yarn/patches | ||
!.yarn/releases | ||
!.yarn/plugins | ||
!.yarn/sdks | ||
!.yarn/versions | ||
.pnp.* | ||
|
||
# Compiled source files | ||
**/build | ||
**/*.tsbuildinfo | ||
*.map | ||
|
||
.secrets |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
CHANGELOG*.md | ||
package.json | ||
package-lock.json | ||
build/ | ||
.github/workflows/ | ||
.github/actions/**/*.yml | ||
cache/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
module.exports = { | ||
semi: true, | ||
trailingComma: "all", | ||
singleQuote: false, | ||
printWidth: 80, | ||
useTabs: true, | ||
tabWidth: 4, | ||
endOfLine: "lf", | ||
|
||
plugins: [require("prettier-plugin-organize-imports")], | ||
|
||
overrides: [ | ||
{ | ||
files: "packages/config/**/*.json", | ||
options: { | ||
printWidth: 120, | ||
}, | ||
}, | ||
{ | ||
files: "*.yml", | ||
options: { | ||
useTabs: false, | ||
tabWidth: 2, | ||
singleQuote: true, | ||
}, | ||
}, | ||
], | ||
}; |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
enableGlobalCache: true | ||
|
||
nodeLinker: pnpm | ||
|
||
plugins: | ||
- path: .yarn/plugins/@yarnpkg/plugin-typescript.cjs | ||
spec: "@yarnpkg/plugin-typescript" | ||
- path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs | ||
spec: "@yarnpkg/plugin-workspace-tools" | ||
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs | ||
spec: "@yarnpkg/plugin-interactive-tools" | ||
|
||
preferInteractive: true | ||
|
||
yarnPath: .yarn/releases/yarn-3.2.1.cjs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
{ | ||
"name": "@zwave-js/firmware-updates", | ||
"version": "0.0.1", | ||
"description": "The firmware update service for Z-Wave JS", | ||
"main": "build/server.js", | ||
"repository": "https://github.com/zwave-js/firmware-updates", | ||
"author": "Dominic Griesel <[email protected]>", | ||
"license": "MIT", | ||
"scripts": { | ||
"build": "tsc --verbose", | ||
"clean": "tsc --clean", | ||
"watch": "yarn run build --watch --pretty", | ||
"lint": "eslint .", | ||
"dev": "nodemon src/server.ts", | ||
"start": "node build/server.js" | ||
}, | ||
"devDependencies": { | ||
"@tsconfig/node16": "^1.0.3", | ||
"@types/eslint": "^8", | ||
"@types/node": "^18.0.0", | ||
"@types/prettier": "^2", | ||
"@types/source-map-support": "^0.5.4", | ||
"@typescript-eslint/eslint-plugin": "^5.30.0", | ||
"@typescript-eslint/parser": "^5.30.0", | ||
"eslint": "^8.18.0", | ||
"eslint-config-prettier": "^8.5.0", | ||
"eslint-plugin-prettier": "^4.1.0", | ||
"fastify": "^4.2.0", | ||
"nodemon": "^2.0.18", | ||
"prettier": "^2.7.1", | ||
"prettier-plugin-organize-imports": "^3.0.0", | ||
"ts-node": "^10.8.1", | ||
"typescript": "~4.7.4" | ||
}, | ||
"packageManager": "[email protected]" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import fastifyLib from "fastify"; | ||
|
||
const fastify = fastifyLib({ logger: true }); | ||
|
||
// Declare a route | ||
fastify.get("/", async (request, reply) => { | ||
return { hello: "world!" }; | ||
}); | ||
|
||
// Run the server! | ||
async function start() { | ||
try { | ||
await fastify.listen({ port: 3000 }); | ||
} catch (err) { | ||
fastify.log.error(err); | ||
process.exit(1); | ||
} | ||
} | ||
void start(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"extends": "@tsconfig/node16/tsconfig.json", | ||
"compilerOptions": { | ||
"importsNotUsedAsValues": "error", | ||
"pretty": true, | ||
}, | ||
"include": ["src/**/*.ts"] | ||
} |
Oops, something went wrong.