-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·62 lines (48 loc) · 1.28 KB
/
install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/usr/bin/env bash
set -euxo pipefail
# Make sure we're in the right directory.
if [ ! -f "./package.json" ]; then
echo "Aborting. File package.json does not exist in directory $(pwd)"
exit 1
fi
# Install package
npm install --save-dev "@thelabnyc/standards@latest"
# Setup symlinks
for SYMLINK in ".editorconfig" ".markdownlint.json"
do
ln -f -s "./node_modules/@thelabnyc/standards/$SYMLINK" "$SYMLINK"
done
# Setup commitlint
cat > ".commitlintrc.ts"<< EOF
import type { UserConfig } from "@commitlint/types";
const Configuration: UserConfig = {
extends: ["@thelabnyc/standards/commitlint.mjs"],
};
export default Configuration;
EOF
# Setup Prettier
cat > "prettier.config.js"<< EOF
const base = require("@thelabnyc/standards/prettier.config");
module.exports = {
...base,
};
EOF
# Setup ESLint
cat > "eslint.config.mjs"<< EOF
import path from "node:path";
import { fileURLToPath } from "node:url";
import { getTSConfig } from "@thelabnyc/standards/eslint.mjs";
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
export default getTSConfig({
parserOptions: {
tsconfigRootDir: __dirname,
},
});
EOF
# Setup Stylelint
cat > ".stylelintrc.json"<< EOF
{
"extends": "@thelabnyc/standards/stylelint.config"
}
EOF