diff --git a/flake.nix b/flake.nix index 6361ea4..25c547a 100644 --- a/flake.nix +++ b/flake.nix @@ -3,6 +3,7 @@ outputs = { self }: { templates = { + # flakes flake-base = { path = ./flakes/base; description = "An empty flake for each default system"; @@ -11,6 +12,11 @@ path = ./flakes/rust; description = "Flake to develop, build and run a rust application"; }; + # starters + starter-typescript = { + path = ./starters/typescript; + description = "Basic configuration for the typescript project"; + }; }; defaultTemplate = self.templates.flake-base; }; diff --git a/starters/typescript/.envrc b/starters/typescript/.envrc new file mode 100644 index 0000000..3550a30 --- /dev/null +++ b/starters/typescript/.envrc @@ -0,0 +1 @@ +use flake diff --git a/starters/typescript/.eslintrc.yml b/starters/typescript/.eslintrc.yml new file mode 100644 index 0000000..53f0d3b --- /dev/null +++ b/starters/typescript/.eslintrc.yml @@ -0,0 +1,35 @@ +env: + es6: true + node: true +parser: "@typescript-eslint/parser" +parserOptions: + ecmaVersion: 2019 + sourceType: "module" +extends: + - prettier + - plugin:prettier/recommended + - plugin:@typescript-eslint/recommended +rules: + "@typescript-eslint/no-unused-vars": + - error + - vars: all + args: after-used + argsIgnorePattern: ^_ + varsIgnorePattern: ^_ + ignoreRestSiblings: true + "@typescript-eslint/no-empty-interface": off + "@typescript-eslint/no-explicit-any": off + "@typescript-eslint/explicit-function-return-type": + - warn + - allowExpressions: false + allowTypedFunctionExpressions: true + allowHigherOrderFunctions: true + "@typescript-eslint/camelcase": off + "@typescript-eslint/no-use-before-define": off + + # need for fast move to ts + "@typescript-eslint/no-var-requires": off + "@typescript-eslint/ban-types": off + "@typescript-eslint/ban-ts-ignore": off + "@typescript-eslint/ban-ts-comment": off + "@typescript-eslint/explicit-module-boundary-types": off diff --git a/starters/typescript/.gitignore b/starters/typescript/.gitignore new file mode 100644 index 0000000..0b467cb --- /dev/null +++ b/starters/typescript/.gitignore @@ -0,0 +1,2 @@ +.direnv/ +node_modules/ diff --git a/starters/typescript/.prettierrc b/starters/typescript/.prettierrc new file mode 100644 index 0000000..a409df5 --- /dev/null +++ b/starters/typescript/.prettierrc @@ -0,0 +1,7 @@ +{ + "tabWidth": 4, + "semi": true, + "singleQuote": true, + "trailingComma": "all", + "printWidth": 100 +} diff --git a/starters/typescript/flake.nix b/starters/typescript/flake.nix new file mode 100644 index 0000000..ad5b5cc --- /dev/null +++ b/starters/typescript/flake.nix @@ -0,0 +1,17 @@ +{ + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; + utils.url = "github:numtide/flake-utils"; + }; + + outputs = { self, nixpkgs, utils }: + utils.lib.eachDefaultSystem (system: + let + pkgs = import nixpkgs { inherit system; }; + in + { + devShells.default = pkgs.mkShell { + packages = with pkgs; [ nodejs-16_x ]; + }; + }); +} diff --git a/starters/typescript/package.json b/starters/typescript/package.json new file mode 100644 index 0000000..f6ce140 --- /dev/null +++ b/starters/typescript/package.json @@ -0,0 +1,21 @@ +{ + "name": "coc-nvim-range-create-bug", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "author": "", + "license": "ISC", + "devDependencies": { + "@typescript-eslint/eslint-plugin": "^5.36.2", + "@typescript-eslint/parser": "^5.36.2", + "eslint": "^8.23.0", + "eslint-config-prettier": "^8.5.0", + "eslint-plugin-prettier": "^4.2.1", + "prettier": "^2.7.1", + "ts-node": "^10.9.1", + "typescript": "^4.8.2" + } +} diff --git a/starters/typescript/tsconfig.json b/starters/typescript/tsconfig.json new file mode 100644 index 0000000..63f3ed4 --- /dev/null +++ b/starters/typescript/tsconfig.json @@ -0,0 +1,15 @@ +{ + "compilerOptions": { + "outDir": "target", + "module": "commonjs", + "target": "es2020", + "lib": ["es2020"], + "moduleResolution": "node", + "rootDir": "src", + "skipLibCheck": true, + "strict": true, + "noImplicitReturns": true, + "noImplicitThis": true, + "noImplicitAny": true + } +}