Skip to content

Commit

Permalink
chore: include cypress and chai rules
Browse files Browse the repository at this point in the history
  • Loading branch information
silvester-pari committed Jun 19, 2024
1 parent b03070c commit 1b6f353
Show file tree
Hide file tree
Showing 4 changed files with 133 additions and 8 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ This reusable config aims to be our default way of setting up linting and format
- recommended eslint config
- recommended typescript-eslint
- typescript-eslint parser
- vue-eslint parser
- cypress rules
- chai friendly errors

The config also includes a minimal set of rules, defined in [index.js](./index.js).

Expand Down
14 changes: 12 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,39 @@ import globals from "globals";
import eslint from "@eslint/js";
import tseslint from "typescript-eslint";
import tsParser from "@typescript-eslint/parser";
import vueParser from "vue-eslint-parser";
import pluginCypress from "eslint-plugin-cypress/flat";
import pluginChaiFriendly from "eslint-plugin-chai-friendly";

export default [
pluginCypress.configs.recommended,
eslint.configs.recommended,
...tseslint.configs.recommended,
eslintConfigPrettier,
{
plugins: { "chai-friendly": pluginChaiFriendly },
languageOptions: {
parser: tsParser,
parser: vueParser,
parserOptions: {
parser: tsParser,
},
globals: {
...globals.node,
...globals.browser,
},
},
rules: {
"@typescript-eslint/ban-ts-comment": "warn",
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/no-unused-vars": [
"error",
{
varsIgnorePattern: "^_",
argsIgnorePattern: "^_",
caughtErrorsIgnorePattern: "^_",
},
],
"@typescript-eslint/no-unused-expressions": "off", // disable original rule
"chai-friendly/no-unused-expressions": "error",
},
},
];
115 changes: 112 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 6 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@eox/eslint-config",
"version": "2.0.0-alpha",
"description": "EOX Prettier and ESLint config for Vue.js projects",
"version": "2.0.0",
"description": "EOX Prettier and ESLint config for JS projects",
"main": "index.js",
"repository": "https://github.com/EOX-A/code-style-vue",
"author": "EOX",
Expand All @@ -11,8 +11,11 @@
"@eslint/js": "^9.4.0",
"eslint": "^9.4.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-chai-friendly": "^1.0.0",
"eslint-plugin-cypress": "^3.3.0",
"globals": "^15.4.0",
"prettier": "^3.3.2",
"typescript-eslint": "^8.0.0-alpha.30"
"typescript-eslint": "^8.0.0-alpha.30",
"vue-eslint-parser": "^9.4.3"
}
}

0 comments on commit 1b6f353

Please sign in to comment.