Skip to content

Commit

Permalink
feat(*): initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
b-kelly committed Aug 17, 2022
0 parents commit ac471dc
Show file tree
Hide file tree
Showing 16 changed files with 5,474 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
4 changes: 4 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx --no -- commitlint --edit "${1}";
9 changes: 9 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
The MIT License (MIT)

Copyright 2022-2022 Stack Exchange Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
5,207 changes: 5,207 additions & 0 deletions package-lock.json

Large diffs are not rendered by default.

41 changes: 41 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"name": "stacks-utils",
"private": true,
"version": "1.0.0",
"description": "monorepo for Stacks config files and other utilities",
"author": "",
"license": "MIT",
"workspaces": [
"packages/*"
],
"scripts": {
"lint:eslint": "eslint .",
"lint:prettier": "prettier --check . --end-of-line auto",
"prepare": "husky install"
},
"devDependencies": {
"@commitlint/cli": "^17.0.3",
"eslint": "^8.22.0",
"husky": "^8.0.1",
"prettier": "^2.7.1"
},
"commitlint": {
"extends": [
"@stackoverflow/commitlint-config"
]
},
"eslintConfig": {
"env": {
"node": true
},
"parserOptions": {
"project": [
"./tsconfig.json"
]
},
"extends": [
"@stackoverflow"
]
},
"prettier": "@stackoverflow/prettier-config"
}
15 changes: 15 additions & 0 deletions packages/browserslist-config/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module.exports = [
"last 2 versions",
"not dead",
"not ie > 0",
"not op_mini all",
"not baidu > 0",
"not and_ff > 0",
"not and_qq > 0",
"not kaios > 0",
"not op_mob > 0",
"not ie_mob > 0",
"not and_uc > 0",
"not Samsung > 0",
"not Android > 0",
];
21 changes: 21 additions & 0 deletions packages/browserslist-config/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"name": "@stackoverflow/browserslist-config",
"version": "1.0.0",
"description": "Stacks Browserslist shared config",
"main": "index.js",
"author": "Stack Exchange Inc",
"license": "MIT",
"keywords": [
"stacks",
"browserslist",
"browserslist-config"
],
"repository": {
"type": "git",
"url": "git+https://github.com/StackExchange/stacks-utils.git"
},
"bugs": {
"url": "https://github.com/StackExchange/stacks-utils/issues"
},
"homepage": "https://github.com/StackExchange/stacks-utils#readme"
}
6 changes: 6 additions & 0 deletions packages/commitlint-config/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
extends: ["@commitlint/config-conventional"],
rules: {
"scope-empty": [2, "never"],
},
};
24 changes: 24 additions & 0 deletions packages/commitlint-config/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"name": "@stackoverflow/commitlint-config",
"version": "1.0.0",
"description": "Stacks CommitLint shared config",
"main": "index.js",
"author": "Stack Exchange Inc",
"license": "MIT",
"keywords": [
"stacks",
"commitlint",
"commitlint-config"
],
"repository": {
"type": "git",
"url": "git+https://github.com/StackExchange/stacks-utils.git"
},
"bugs": {
"url": "https://github.com/StackExchange/stacks-utils/issues"
},
"homepage": "https://github.com/StackExchange/stacks-utils#readme",
"dependencies": {
"@commitlint/config-conventional": "^17.0.3"
}
}
42 changes: 42 additions & 0 deletions packages/eslint-config/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
module.exports = {
plugins: ["@typescript-eslint", "jest"],
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"prettier",
"plugin:no-unsanitized/DOM",
],
rules: {
"no-console": "error",
"no-alert": "error",
"no-process-env": "error",
},
overrides: [
{
// enable
files: ["**/*.ts", "**/*.tsx"],
parser: "@typescript-eslint/parser",
parserOptions: {
tsconfigRootDir: __dirname,
},
},
{
// only enable jest rules in non-e2e test files
files: ["**/!(*.e2e).test.ts"],
extends: ["plugin:jest/recommended", "plugin:jest/style"],
rules: {
"jest/no-disabled-tests": "off",
"jest/consistent-test-it": ["error", { fn: "it" }],
},
},
{
// enable a subset of jest rules in e2e test files, since the syntax is similar-ish
files: ["**/*.e2e.test.ts"],
extends: ["plugin:jest/recommended"],
rules: {
"jest/no-standalone-expect": "off",
},
},
],
};
31 changes: 31 additions & 0 deletions packages/eslint-config/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"name": "@stackoverflow/eslint-config",
"version": "1.0.0",
"description": "Stacks ESLint shared config",
"main": "index.js",
"author": "Stack Exchange Inc",
"license": "MIT",
"keywords": [
"stacks",
"eslint",
"eslint-config"
],
"repository": {
"type": "git",
"url": "git+https://github.com/StackExchange/stacks-utils.git"
},
"bugs": {
"url": "https://github.com/StackExchange/stacks-utils/issues"
},
"homepage": "https://github.com/StackExchange/stacks-utils#readme",
"peerDependencies": {
"eslint": ">=8"
},
"dependencies": {
"@typescript-eslint/eslint-plugin": "^5.33.1",
"@typescript-eslint/parser": "^5.33.1",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-jest": "^26.8.3",
"eslint-plugin-no-unsanitized": "^4.0.1"
}
}
8 changes: 8 additions & 0 deletions packages/prettier-config/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module.exports = {
tabWidth: 4,
semi: true,
singleQuote: false,
quoteProps: "consistent",
trailingComma: "es5",
printWidth: 80,
};
24 changes: 24 additions & 0 deletions packages/prettier-config/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"name": "@stackoverflow/prettier-config",
"version": "1.0.0",
"description": "Stacks Prettier shared config",
"main": "index.js",
"author": "Stack Exchange Inc",
"license": "MIT",
"keywords": [
"stacks",
"prettier",
"prettier-config"
],
"repository": {
"type": "git",
"url": "git+https://github.com/StackExchange/stacks-utils.git"
},
"bugs": {
"url": "https://github.com/StackExchange/stacks-utils/issues"
},
"homepage": "https://github.com/StackExchange/stacks-utils#readme",
"peerDependencies": {
"prettier": ">=2"
}
}
19 changes: 19 additions & 0 deletions packages/tsconfig/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"name": "@stackoverflow/tsconfig",
"version": "1.0.0",
"description": "Stacks base TSConfig file",
"author": "Stack Exchange Inc",
"license": "MIT",
"keywords": [
"stacks",
"tsconfig"
],
"repository": {
"type": "git",
"url": "git+https://github.com/StackExchange/stacks-utils.git"
},
"bugs": {
"url": "https://github.com/StackExchange/stacks-utils/issues"
},
"homepage": "https://github.com/StackExchange/stacks-utils#readme"
}
16 changes: 16 additions & 0 deletions packages/tsconfig/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"compilerOptions": {
"sourceMap": true,
"noImplicitAny": true,
"module": "esnext",
"target": "es6",
"allowJs": true,
"esModuleInterop": true,
"moduleResolution": "node",
"declaration": true,
"skipLibCheck": true,
"resolveJsonModule": true
},
"$schema": "https://json.schemastore.org/tsconfig",
"display": "Stacks"
}
6 changes: 6 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": "./packages/tsconfig/tsconfig.json",
"compilerOptions": {
"outDir": "./tmp"
}
}

0 comments on commit ac471dc

Please sign in to comment.