add linter

This commit is contained in:
hazycora 2023-08-02 17:17:01 -05:00
parent 28906bfb80
commit d684ad6045
No known key found for this signature in database
GPG key ID: 215AF1F81F86940E
6 changed files with 1091 additions and 22 deletions

14
.eslintignore Normal file
View file

@ -0,0 +1,14 @@
.DS_Store
node_modules
/build
/.svelte-kit
/package
.env
.env.\*
!.env.example
# Ignore files for PNPM, NPM and YARN
pnpm-lock.yaml
package-lock.json
yarn.lock

28
.eslintrc.cjs Normal file
View file

@ -0,0 +1,28 @@
module.exports = {
root: true,
extends: ['eslint:recommended', 'prettier', 'plugin:unicorn/recommended'],
parserOptions: {
sourceType: 'module',
ecmaVersion: 2022
},
env: {
browser: true,
es2017: true,
node: true
},
plugins: ['unicorn'],
rules: {
'no-var': 'error',
'prefer-const': 'error',
quotes: ['error', 'single', { avoidEscape: true }],
'quote-props': ['error', 'as-needed'],
'no-constant-condition': ['error', { checkLoops: false }],
'no-duplicate-imports': 'error',
'no-inner-declarations': 'off',
'unicorn/prevent-abbreviations': 'off',
'unicorn/prefer-string-replace-all': 'off',
'unicorn/numeric-separators-style': 'off',
'unicorn/template-indent': 'off',
'unicorn/no-nested-ternary': 'off'
}
}

13
.prettierignore Normal file
View file

@ -0,0 +1,13 @@
.DS_Store
node_modules
/build
/.svelte-kit
/package
.env
.env.*
!.env.example
# Ignore files for PNPM, NPM and YARN
pnpm-lock.yaml
package-lock.json
yarn.lock

8
.prettierrc Normal file
View file

@ -0,0 +1,8 @@
{
"semi": false,
"useTabs": true,
"singleQuote": true,
"trailingComma": "none",
"arrowParens": "avoid",
"bracketSameLine": false
}

View file

@ -1,20 +1,27 @@
{
"name": "opengraph",
"version": "1.0.0",
"description": "OG server for git.gay",
"main": "server.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [
"git.gay",
"og"
],
"author": "besties",
"license": "ISC",
"dependencies": {
"@besties/html2png": "^0.1.2",
"express": "^4.18.2"
},
"type": "module"
"name": "opengraph",
"version": "1.0.0",
"description": "OG server for git.gay",
"main": "server.js",
"scripts": {
"lint": "prettier --check . && eslint .",
"format": "prettier --write ."
},
"keywords": [
"git.gay",
"og"
],
"author": "besties",
"license": "ISC",
"dependencies": {
"@besties/html2png": "^0.1.2",
"express": "^4.18.2"
},
"type": "module",
"devDependencies": {
"eslint": "^8.46.0",
"eslint-config-prettier": "^8.9.0",
"eslint-plugin-unicorn": "^48.0.1",
"prettier": "^3.0.0"
}
}

File diff suppressed because it is too large Load diff