-
Notifications
You must be signed in to change notification settings - Fork 0
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
6 changed files
with
247 additions
and
7 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,5 @@ | ||
lib | ||
tsconfig.json | ||
package.json | ||
.eslintrc.json | ||
rollup.config.ts |
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,121 @@ | ||
{ | ||
"env": { | ||
"es6": true, | ||
"node": true | ||
}, | ||
"extends": [ | ||
"airbnb-typescript/base", | ||
"plugin:@typescript-eslint/eslint-recommended", | ||
"plugin:@typescript-eslint/recommended", | ||
"plugin:json/recommended" | ||
], | ||
"globals": { | ||
"Atomics": "readonly", | ||
"SharedArrayBuffer": "readonly" | ||
}, | ||
"parser": "@typescript-eslint/parser", | ||
"parserOptions": { | ||
"project": "./tsconfig.json", | ||
"ecmaVersion": 2020, | ||
"sourceType": "module" | ||
}, | ||
"plugins": [ | ||
"@typescript-eslint", | ||
"import" | ||
], | ||
"rules": { | ||
"@typescript-eslint/no-shadow": 0, | ||
"guard-for-in": 0, | ||
"multiline-ternary": [ | ||
"error", | ||
"always" | ||
], | ||
"@typescript-eslint/indent": [ | ||
"error", | ||
"tab", | ||
{ | ||
"SwitchCase": 1 | ||
} | ||
], | ||
"linebreak-style": [ | ||
"error", | ||
"unix" | ||
], | ||
"@typescript-eslint/quotes": [ | ||
"error", | ||
"double", | ||
{ | ||
"allowTemplateLiterals": true | ||
} | ||
], | ||
"eqeqeq": [ | ||
"error", | ||
"always" | ||
], | ||
"no-else-return": [ | ||
"error", | ||
{ | ||
"allowElseIf": false | ||
} | ||
], | ||
"no-floating-decimal": "error", | ||
"no-implicit-coercion": "error", | ||
"no-multi-spaces": [ | ||
"warn", | ||
{ | ||
"ignoreEOLComments": true | ||
} | ||
], | ||
"yoda": "error", | ||
"@typescript-eslint/no-unused-vars": [ | ||
"error", | ||
{ | ||
"args": "none" | ||
} | ||
], | ||
"no-tabs": "off", | ||
"max-len": [ | ||
"error", | ||
{ | ||
"code": 120, | ||
"ignoreComments": true | ||
} | ||
], | ||
"no-console": "off", | ||
"consistent-return": "off", | ||
"class-methods-use-this": "off", | ||
"import/prefer-default-export": "off", | ||
"no-plusplus": "off", | ||
"no-nested-ternary": "error", | ||
"no-return-assign": "off", | ||
"no-restricted-syntax": "off", | ||
"no-await-in-loop": "off", | ||
"no-mixed-spaces-and-tabs": [ | ||
"error", | ||
"smart-tabs" | ||
], | ||
"import/no-cycle": "off", | ||
"@typescript-eslint/explicit-function-return-type": "warn", | ||
"import/extensions": "off", | ||
"no-underscore-dangle": [ | ||
"error", | ||
{ | ||
"allowAfterThis": true | ||
} | ||
], | ||
"no-continue": "off", | ||
"no-empty": [ | ||
"error", | ||
{ | ||
"allowEmptyCatch": true | ||
} | ||
], | ||
"@typescript-eslint/explicit-module-boundary-types": "off", | ||
"no-void": "off", | ||
"curly": [ | ||
"error", | ||
"all" | ||
], | ||
"no-return-await": "error" | ||
} | ||
} |
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,33 @@ | ||
.SILENT: | ||
|
||
PACKAGE_VERSION=$(shell cat package.json | grep -i version | sed -e "s/ //g" | cut -c 12- | sed -e "s/\",//g") | ||
|
||
.PHONY: install | ||
install: | ||
pnpm install | ||
|
||
.PHONY: build | ||
build: | ||
pnpm run build | ||
|
||
.PHONY: lint | ||
lint: | ||
pnpm run lint | ||
|
||
.PHONY: npmjs | ||
npmjs: | ||
echo "//registry.npmjs.org/:_authToken=$$NPM_TOKEN" >> .npmrc | ||
echo "@hecht-a:registry=https://registry.npmjs.org/" >> .npmrc | ||
|
||
.PHONY: publish-npmjs | ||
publish-npmjs: | ||
yarn publish --access public --registry https://registry.npmjs.org/ --new-version $(PACKAGE_VERSION) --non-interactive | ||
|
||
.PHONY: github-tag | ||
github-tag: | ||
git tag -a v$(PACKAGE_VERSION) -m "update to v$(PACKAGE_VERSION)" | ||
git push origin v$(PACKAGE_VERSION) | ||
|
||
.PHONY: types | ||
types: | ||
pnpm run types |
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 |
---|---|---|
@@ -1,15 +1,44 @@ | ||
{ | ||
"name": "form-validator", | ||
"private": true, | ||
"name": "@hecht-a/form-validator", | ||
"version": "1.0.0", | ||
"description": "This is a package to validate forms in frontend.", | ||
"private": false, | ||
"type": "module", | ||
"main": "lib/index.js", | ||
"types": "lib/index.d.ts", | ||
"files": [ | ||
"lib" | ||
], | ||
"author": { | ||
"name": "Axel Hecht", | ||
"url": "https://github.com/hecht-a" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/hecht-a/form-validator/issues" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/hecht-a/form-validator.git" | ||
}, | ||
"scripts": { | ||
"dev": "vite", | ||
"build": "tsc && vite build", | ||
"preview": "vite preview" | ||
"build": "rollup --config rollup.config.ts", | ||
"types": "tsc --declaration --emitDeclarationOnly --project tsconfig.types.json", | ||
"lint": "eslint --ext .ts,.js ." | ||
}, | ||
"devDependencies": { | ||
"typescript": "^4.6.4", | ||
"vite": "^3.0.7" | ||
"@rollup/plugin-typescript": "^8.4.0", | ||
"@typescript-eslint/eslint-plugin": "^4.33.0", | ||
"@typescript-eslint/parser": "^4.33.0", | ||
"eslint": "^7.32.0", | ||
"eslint-config-airbnb-base": "^14.2.1", | ||
"eslint-config-airbnb-typescript": "^12.3.1", | ||
"eslint-plugin-import": "^2.26.0", | ||
"eslint-plugin-json": "^2.1.2", | ||
"rollup": "^2.79.0", | ||
"rollup-plugin-delete": "^2.0.0", | ||
"rollup-plugin-terser": "^7.0.2", | ||
"tslib": "^2.4.0", | ||
"typescript": "^4.8.2", | ||
"vite": "^3.1.0" | ||
} | ||
} |
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,43 @@ | ||
import remove from "rollup-plugin-delete"; | ||
import {resolve} from "node:path"; | ||
import {terser} from "rollup-plugin-terser"; | ||
import typescript from "@rollup/plugin-typescript"; | ||
|
||
export default [ | ||
{ | ||
input: resolve("src", "Validator/index.ts"), | ||
plugins: [ | ||
remove({targets: resolve("lib", "*")}), | ||
typescript(), | ||
terser() | ||
], | ||
output: { | ||
file: resolve("lib", "Validator/index.js"), | ||
format: "cjs" | ||
} | ||
}, | ||
{ | ||
input: resolve("src", "Error/index.ts"), | ||
plugins: [ | ||
remove({targets: resolve("lib", "*")}), | ||
typescript(), | ||
terser() | ||
], | ||
output: { | ||
file: resolve("lib", "Error/index.js.js"), | ||
format: "cjs" | ||
} | ||
}, | ||
{ | ||
input: resolve("src", "index.ts"), | ||
plugins: [ | ||
remove({targets: resolve("lib", "*")}), | ||
typescript(), | ||
terser() | ||
], | ||
output: { | ||
file: resolve("lib", "index.js"), | ||
format: "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,9 @@ | ||
{ | ||
"extends": "./tsconfig.json", | ||
"files": ["src/index.ts"], | ||
"compilerOptions": { | ||
"declaration": true, | ||
"declarationMap": true, | ||
"outDir": "./lib" | ||
} | ||
} |