Skip to content

Commit

Permalink
downgrade to eslint 8
Browse files Browse the repository at this point in the history
change default config to support typescript
add test commit github workflow
  • Loading branch information
TimurRin committed Jun 19, 2024
1 parent c08e2eb commit 6916a93
Show file tree
Hide file tree
Showing 7 changed files with 470 additions and 194 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/test-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Test pushed commits

on:
push:
branches: ["**"]
workflow_dispatch:

jobs:
test-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 20
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: npm test
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,12 @@ Create `eslint.config.js` with this content:
import cinnabarPlugin from "@cinnabar-forge/eslint-plugin";

export default [
...cinnabarPlugin.default,
...cinnabarPlugin.default.map((config) => ({
...config,
files: ["src/**/*.ts"],
})),
];

```

## Changelog
Expand Down
8 changes: 8 additions & 0 deletions configs/default.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@ import perfectionistNatural from "eslint-plugin-perfectionist/configs/recommende
import pluginSecurity from "eslint-plugin-security";
import sonarjs from "eslint-plugin-sonarjs";
import globals from "globals";
import tseslint from "typescript-eslint";

export default [
js.configs.recommended,
...tseslint.configs.strict,
...tseslint.configs.stylistic,
jsdoc.configs["flat/recommended"],
perfectionistNatural,
nodePlugin.configs["flat/recommended-module"],
Expand All @@ -21,9 +24,14 @@ export default [
globals: {
...globals.node,
},
parser: tseslint.parser,
parserOptions: {
project: true,
},
sourceType: "module",
},
plugins: {
"@typescript-eslint": tseslint.plugin,
jsdoc,
},
rules: {
Expand Down
40 changes: 36 additions & 4 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,42 @@
import js from "@eslint/js";
import eslintConfigPrettier from "eslint-config-prettier";
import eslintPlugin from "eslint-plugin-eslint-plugin";

import cfConfig from "./configs/default.js";
import jsdoc from "eslint-plugin-jsdoc";
import nodePlugin from "eslint-plugin-n";
import perfectionistNatural from "eslint-plugin-perfectionist/configs/recommended-natural";
import pluginSecurity from "eslint-plugin-security";
import sonarjs from "eslint-plugin-sonarjs";
import globals from "globals";

export default [
...cfConfig,
eslintPlugin.configs["flat/all"],
js.configs.recommended,
jsdoc.configs["flat/recommended"],
perfectionistNatural,
nodePlugin.configs["flat/recommended-module"],
pluginSecurity.configs.recommended,
sonarjs.configs.recommended,
eslintConfigPrettier,
{
...eslintPlugin.configs["flat/all"],
languageOptions: {
sourceType: "module",
},
},
{
languageOptions: {
ecmaVersion: 2022,
globals: {
...globals.node,
},
sourceType: "module",
},
plugins: {
jsdoc,
},
rules: {
"no-var": "error",
},
},
{
ignores: ["cinnabar.js"],
},
Expand Down
Loading

0 comments on commit 6916a93

Please sign in to comment.