Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to Node 18 #298

Merged
merged 5 commits into from
Oct 2, 2024
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
4 changes: 0 additions & 4 deletions .eslintignore

This file was deleted.

54 changes: 0 additions & 54 deletions .eslintrc.json

This file was deleted.

7 changes: 4 additions & 3 deletions .github/workflows/pull-request-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,19 @@ jobs:

strategy:
matrix:
node-version: [16.x]
node-version: [18.x]

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Setup Node.js ${{ matrix.node-version }}
- name: Set up Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- uses: actions/cache@v3
- name: Set up cache for NPM modules
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/push-build-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:

strategy:
matrix:
node-version: [16.x]
node-version: [18.x]

steps:
- name: Checkout repository
Expand Down Expand Up @@ -60,8 +60,8 @@ jobs:
artifact_paths: |
bin
node_modules
config/default.yml
config/main.yml
config/default.*
config/main.*
*.sh
artifact_destination: /home/mojiradiscordbot/mojira-discord-bot
script: |
Expand Down
115 changes: 115 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
import typescriptEslint from "@typescript-eslint/eslint-plugin";
import stylistic from "@stylistic/eslint-plugin";
import globals from "globals";
import tsParser from "@typescript-eslint/parser";
import path from "node:path";
import { fileURLToPath } from "node:url";
import js from "@eslint/js";
import { FlatCompat } from "@eslint/eslintrc";

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all
});

export default [{
ignores: [
// don't ever lint node_modules
"**/node_modules",
// don't lint build output (make sure it's set to your correct build folder name)
"**/bin"
],
}, ...compat.extends("eslint:recommended", "plugin:@typescript-eslint/recommended"), {
files: ["**/*.ts"],

plugins: {
"@typescript-eslint": typescriptEslint,
"@stylistic": stylistic,
},

languageOptions: {
globals: {
...globals.node,
},

parser: tsParser,
ecmaVersion: 5,
sourceType: "module",

parserOptions: {
project: "tsconfig.json",
},
},

rules: {
"brace-style": ["warn", "1tbs", {
allowSingleLine: true,
}],

"comma-dangle": ["warn", "always-multiline"],
"comma-spacing": "warn",
"comma-style": "warn",
curly: ["warn", "multi-line", "consistent"],
"dot-location": ["warn", "property"],
"eol-last": "warn",
"@stylistic/indent": ["warn", "tab"],
"keyword-spacing": ["warn"],

"max-nested-callbacks": ["warn", {
max: 4,
}],

"max-statements-per-line": ["warn", {
max: 2,
}],

"no-empty-function": "warn",
"no-floating-decimal": "warn",
"@typescript-eslint/no-floating-promises": "error",
"no-inline-comments": "warn",
"no-lonely-if": "warn",
"no-multi-spaces": "warn",

"no-multiple-empty-lines": ["warn", {
max: 2,
maxEOF: 1,
maxBOF: 0,
}],

"no-shadow": "off",

"@typescript-eslint/no-shadow": ["error", {
allow: ["err", "resolve", "reject"],
}],

"no-trailing-spaces": ["warn"],
"no-var": "error",
"object-curly-spacing": ["warn", "always"],
"prefer-const": "error",
quotes: ["warn", "single"],
"@stylistic/semi": ["warn"],
"space-before-blocks": "warn",

"space-before-function-paren": ["warn", {
anonymous: "never",
named: "never",
asyncArrow: "always",
}],

"space-in-parens": ["warn", "always", {
exceptions: ["empty"],
}],

"space-infix-ops": "warn",
"space-unary-ops": "warn",
"spaced-comment": "warn",
"template-curly-spacing": ["warn", "always"],

yoda: ["error", "never", {
exceptRange: true,
}],
},
}];
Loading
Loading