Skip to content

Commit

Permalink
chore: migrate to eslint v9
Browse files Browse the repository at this point in the history
  • Loading branch information
david-luna committed Jun 2, 2024
1 parent 75596d0 commit a41e9d0
Show file tree
Hide file tree
Showing 7 changed files with 386 additions and 473 deletions.
37 changes: 0 additions & 37 deletions .eslintrc.json

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: build
name: test
on:
workflow_dispatch:
push:
branches: [ main ]
jobs:
build:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ operators do not use utils and I tried to avoid any internal dependency.
package ESM only so `require` would fail to load the lib. The new flag
`--experimental-require-module` can be used to load the lib if your app
is in `commonjs` format. Checkout [the docs](https://nodejs.org/docs/latest/api/modules.html#loading-ecmascript-modules-using-require).
* Add `tap` operator
* Add `tap` operator

### [0.4.0]

Expand Down
48 changes: 48 additions & 0 deletions eslint.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
const globals = require('globals');
const eslintJs = require('@eslint/js');
const prettierConfig = require('eslint-config-prettier');
const prettierPlugin = require('eslint-plugin-prettier');

module.exports = [
{
// This block should *only* have the "ignores" property.
// https://eslint.org/docs/latest/use/configure/configuration-files#globally-ignoring-files-with-ignores
ignores: ['node_modules/**', '.tap/**'],
},
{
languageOptions: {
ecmaVersion: 2022,
sourceType: 'module',
globals: {
...globals.node,
fetch: false, // not present in node globals (readonly)
},
parserOptions: {
ecmaFeatures: {
jsx: true, // to parse nextjs files
},
},
},
plugins: {
prettier: prettierPlugin,
},
rules: {
...eslintJs.configs.recommended.rules,
...prettierConfig.rules,
'prettier/prettier': ['error'],
'prefer-arrow-callback': 'error',
'func-style': ['error', 'declaration', { allowArrowFunctions: true }],
'no-param-reassign': 'error',
'no-shadow': 'error',
'no-console': 'error',
'max-classes-per-file': 'error',
complexity: 'error',
'no-empty': 'error',
curly: 'error',
'max-len': ['error', { code: 132, comments: 162 }],
'max-lines': ['error', 1000],
quotes: ['error', 'single'],
'newline-per-chained-call': ['error', { ignoreChainWithDepth: 2 }],
},
},
];
Loading

0 comments on commit a41e9d0

Please sign in to comment.