Skip to content

Commit

Permalink
Initial version
Browse files Browse the repository at this point in the history
  • Loading branch information
fsvreddit committed Oct 15, 2024
1 parent 3c5770e commit 288b669
Show file tree
Hide file tree
Showing 9 changed files with 3,465 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# EditorConfig is awesome: https://EditorConfig.org

# top-most EditorConfig file
root = true

[*]
indent_style = space
indent_size = 4
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false
16 changes: 16 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: build-test-lint
on: push
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: checkout repo
uses: actions/checkout@v4
- name: use node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'
- run: npm install
- run: npx tsc --build --clean
- run: npm run test
- run: npx eslint
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
node_modules
.yarn
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
2 changes: 2 additions & 0 deletions devvit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
name: social-links-bot
version: 0.0.1
88 changes: 88 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
import eslint from "@eslint/js";
import tseslint from "typescript-eslint";
import stylistic from '@stylistic/eslint-plugin'
import vitest from "@vitest/eslint-plugin"

export default tseslint.config(
eslint.configs.recommended,
...tseslint.configs.strictTypeChecked,
...tseslint.configs.stylisticTypeChecked,
stylistic.configs.customize({
indent: 4,
quotes: "double",
semi: true,
quoteProps: "consistent-as-needed",
braceStyle: "1tbs",
}),
{
files: ["**/*.test.ts"],
plugins: {
vitest
},
rules: {
...vitest.configs.recommended.rules,
'vitest/valid-title': 'warn',
'vitest/no-commented-out-tests': 'warn'
}
},
{
files: ["**/*.ts", "**/*.tsx"],

languageOptions: {
parserOptions: {
project: "./tsconfig.json",
tsconfigRootDir: import.meta.dirname,
},
},

rules: {
// Extra rules
"eqeqeq": ["error", "always", {
null: "ignore",
}],
"no-self-compare": "error",
"no-template-curly-in-string": "error",
"no-useless-assignment": "error",
"no-nested-ternary": "error",
"no-return-assign": "error",
"no-sequences": "error",
"no-var": "error",
"arrow-body-style": ["error", "as-needed"],
"func-style": ["error", "declaration", {
allowArrowFunctions: true,
}],
"curly": ["error", "all"],
"object-shorthand": ["error", "always"],
"operator-assignment": ["error", "always"],
"camelcase": ["error", {
properties: "always",
}],

// Rules I don't want
"@typescript-eslint/restrict-template-expressions": "off",

// Extra code styling rules
"@stylistic/array-bracket-newline": ["error", "consistent"],
"@stylistic/array-element-newline": ["error", "consistent"],
"@stylistic/func-call-spacing": ["error", "never"],
"@stylistic/function-paren-newline": ["error", "multiline"],
"@stylistic/implicit-arrow-linebreak": ["error", "beside"],

"@stylistic/object-curly-newline": ["error", {
multiline: true,
consistent: true,
}],

"@stylistic/object-property-newline": ["error", {
allowAllPropertiesOnSameLine: true,
}],

"@stylistic/operator-linebreak": ["off"],
"@stylistic/semi-style": ["error", "last"],
"@stylistic/space-before-function-paren": ["error", "always"],
},
},
{
ignores: ["**/node_modules", "**/dist", "eslint.config.mjs", "**/difflib"],
},
);
Loading

0 comments on commit 288b669

Please sign in to comment.