Skip to content

Commit

Permalink
chore: add ESLint support
Browse files Browse the repository at this point in the history
  • Loading branch information
Attacktive committed Dec 21, 2024
1 parent b7ee2a1 commit 8b9c780
Show file tree
Hide file tree
Showing 7 changed files with 1,227 additions and 139 deletions.
4 changes: 2 additions & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ ij_typescript_import_sort_module_name = false
ij_typescript_import_use_node_resolution = true
ij_typescript_imports_wrap = on_every_item
ij_typescript_indent_case_from_switch = true
ij_typescript_indent_chained_calls = false
ij_typescript_indent_chained_calls = true
ij_typescript_indent_package_children = 0
ij_typescript_jsdoc_include_types = false
ij_typescript_jsx_attribute_value = braces
Expand Down Expand Up @@ -278,7 +278,7 @@ ij_javascript_import_sort_module_name = false
ij_javascript_import_use_node_resolution = true
ij_javascript_imports_wrap = on_every_item
ij_javascript_indent_case_from_switch = true
ij_javascript_indent_chained_calls = false
ij_javascript_indent_chained_calls = true
ij_javascript_indent_package_children = 0
ij_javascript_jsx_attribute_value = braces
ij_javascript_keep_blank_lines_in_code = 1
Expand Down
9 changes: 9 additions & 0 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,12 @@ updates:
- "CI/CD"
commit-message:
prefix: 'ci'
groups:
eslint:
patterns:
- 'eslint'
- '@eslint/js'
typescript-eslint:
patterns:
- 'typescript-eslint'
- '@typescript-eslint/*'
21 changes: 21 additions & 0 deletions .github/workflows/eslint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: 'ESLint'
on:
push:
branches: ['main']
pull_request:
branches: ['main']
jobs:
build:
name: 'ESLint'
runs-on: 'ubuntu-latest'
steps:
- name: 'Checkout code'
uses: 'actions/checkout@v4'
- name: 'Install Node.js'
uses: 'actions/setup-node@v4'
with:
node-version: '22.x'
- name: 'Install NPM packages'
run: 'npm ci'
- name: 'Run ESLint'
run: 'npm run lint'
34 changes: 34 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import js from "@eslint/js";
import tsParser from "@typescript-eslint/parser";
import tsPlugin from "@typescript-eslint/eslint-plugin";
import globals from "globals";

export default [
{
languageOptions: {
globals: {
...globals.node,
...globals.browser
}
}
},
js.configs.recommended,
{
files: ["**/*.ts"],
languageOptions: {
parser: tsParser
},
plugins: {
"@typescript-eslint": tsPlugin
},
rules: {
...tsPlugin.configs.recommended.rules
}
},
{
rules: {
"indent": ["warn", "tab", { "MemberExpression": 1 }],
},
files: ["**/*.js", "**/*.ts"]
}
];
Loading

0 comments on commit 8b9c780

Please sign in to comment.