Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
- run: npx tsc --build --clean
- run: npx eslint
9 changes: 8 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
/node_modules/
node_modules
.yarn
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.DS_Store
24 changes: 7 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,13 @@
# Getting started with queue-pruner
This app checks the modqueue every five minutes. If there are any posts or comments in the queue for shadowbanned, suspended or deleted users, the post or comment will be removed if configured to do so.

Your project has been created using a Devvit template.
The app can be configured to remove posts or comments for deleted users or shadowbanned/suspended users - both options can be controlled independently.

## Next up
## Change History

Next up is uploading and developing your app using playtest.
### v1.0.0

In the project directory, you can run:
* Initial Release

### `devvit upload`
## About this app

Upload the app to the App Directory. Uploaded apps are only visible to you (the app owner) and can only be installed to a small test subreddit with less than 200 subscribers.

### `devvit playtest <subreddit-name>`

Installs your app to your test subreddit and starts a playtest session where a new version is installed whenever you save changes to your app code, and logs are continuously streamed.

## Learn more

You can learn more in the [documentation](https://developers.reddit.com/docs/).

You can manage your apps in the [developer portal](https://developers.reddit.com/my/apps).
Modqueue Pruner is open source. You can find the source [here](https://github.com/fsvreddit/queue-pruner).
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"],
"@/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