diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..a61c7f7 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,2 @@ +.data +.data/** diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..df19346 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,24 @@ +root = true + +[*] +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true +indent_style = space +indent_size = 2 +charset = utf-8 + +[Makefile] +indent_style = tab +indent_size = 8 + +[{deps,tools,build}/**] +indent_style = ignore +indent_size = ignore +end_of_line = ignore +trim_trailing_whitespace = ignore +charset = ignore + +[{test/fixtures,deps,build,tools/eslint,tools/gyp,tools/icu,tools/msvs}/**] +insert_final_newline = false diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..158e0db --- /dev/null +++ b/.eslintignore @@ -0,0 +1,7 @@ +*.scss +*.d.ts +*.spec.ts +main.browser.ts +idex.js +node_modules/* +*.e2e.* diff --git a/.eslintrc b/.eslintrc new file mode 100644 index 0000000..a38cabc --- /dev/null +++ b/.eslintrc @@ -0,0 +1,62 @@ +{ + "env": { + "browser": true, + "jest": true, + "es6": true + }, + "plugins": ["import"], + "extends": ["eslint:recommended", "prettier"], + "parserOptions": { + "ecmaVersion": 2020, + "sourceType": "module" + }, + "rules": { + "no-console": [ + "error", + { + "allow": ["debug", "error"] + } + ], + "no-eval": "error", + "import/first": "error", + "camelcase": [ + "error", + { + "ignoreImports": true, + "ignoreDestructuring": true + } + ], + "consistent-return": "warn", + "comma-dangle": ["warn", "always-multiline"], + "constructor-super": "error", + "curly": "error", + "eol-last": "warn", + "eqeqeq": ["error", "smart"], + "import/order": "always", + "new-parens": "error", + "no-debugger": "error", + "no-fallthrough": "off", + "max-len": [ + "warn", + { + "code": 100 + } + ], + "no-shadow": [ + "error", + { + "hoist": "all" + } + ], + "no-trailing-spaces": "warn", + "no-underscore-dangle": "error", + "no-unsafe-finally": "error", + "no-var": "error", + "object-shorthand": "error", + "one-var": ["error", "never"], + "prefer-arrow/prefer-arrow-functions": "off", + "prefer-const": "error", + "radix": "off", + "space-in-parens": ["off", "never"] + } +} diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..baa0c1a --- /dev/null +++ b/.gitignore @@ -0,0 +1,39 @@ +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ +publish/ +build/Release +coverage +lib-cov + +# deps +node_modules/ +__pycache__/ + +# Logs +logs +*.log* + +# Runtime data +pids +*.pid +*.seed + +# Mac files +.DS_Store + +# randoms +*.pyc +dbdata +old +yarn-error.log +dist +*/test-results diff --git a/README.md b/README.md index e5f61e3..144fd53 100644 --- a/README.md +++ b/README.md @@ -1,28 +1,53 @@ -# @mastermindzh/prettier-config +# mastermindzh' code conventions -My preferred prettier configuration. +In this repo you'll find various code convention guideline files (and some .ignore stuff). +Most of my projects will use at least one of these but I strive to use as many as I can. + +**note** these are by no means definitive. Every project has different needs, treat these files as a starting point. -- [Installation](#installation) -- [Configuration](#configuration) - - [package.json](#packagejson) - - [.prettierrc.js](#prettierrcjs) +- [repo outline](#repo-outline) +- [@mastermindzh/prettier-config](#mastermindzhprettier-config) + - [Installation](#installation) + - [Configuration](#configuration) + - [package.json](#packagejson) + - [.prettierrc.js](#prettierrcjs) -## Installation +## repo outline + +```js +. +├── prettier // prettier config +│ ├── index.js +│ └── package.json +├── .dockerignore // things to ignore when building dockers +├── .editorconfig // default editor configuration +├── .eslintignore // files to ignore when using eslint +├── .eslintrc // default eslint config +├── .gitignore // files to ignore when working with git +├── LICENSE +└── README.md +``` + +## @mastermindzh/prettier-config + +My preferred prettier configuration. + +### Installation Simply install the package with npm: `npm install --save-dev @mastermindzh/prettier-config` -## Configuration +### Configuration -Configuring your project to use `@mastermindzh/prettier-config` can be done in several ways. +Configuring your project to use `@mastermindzh/prettier-config` can be done in several ways. The easiest is the [package.json](#packagejson) solution, the most extensible is the [.prettierrc.js](#prettierrcjs) version. -### package.json +#### package.json Simply add a "prettier" key with the package name: @@ -32,7 +57,7 @@ Simply add a "prettier" key with the package name: } ``` -### .prettierrc.js +#### .prettierrc.js This solution requires you to put a `.prettierrc.js` file at the root of your project with the following code: @@ -40,6 +65,6 @@ This solution requires you to put a `.prettierrc.js` file at the root of your pr module.exports = { ...require("@mastermindzh/prettier-config"), // optional overrides: - jsxBracketSameLine: true + jsxBracketSameLine: true, }; ``` diff --git a/index.js b/prettier/index.js similarity index 100% rename from index.js rename to prettier/index.js diff --git a/package.json b/prettier/package.json similarity index 92% rename from package.json rename to prettier/package.json index c3104de..3acbe6d 100644 --- a/package.json +++ b/prettier/package.json @@ -7,7 +7,7 @@ "patch": "npm --no-git-tag-version version patch", "minor": "npm --no-git-tag-version version minor", "major": "npm --no-git-tag-version version major", - "release": "git add -A && git commit -m 'version bump and build' && git push && npm publish --access public", + "release": "git add -A && git commit -m 'version bump and build' && npm publish --access public && echo 'All done, don't forget to push!'", "release-patch": "npm run patch && npm run release", "release-minor": "npm run minor && npm run release", "release-major": "npm run major && npm run release"