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

feat: support eslint v9 #106

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
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
2 changes: 0 additions & 2 deletions .eslintignore

This file was deleted.

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

This file was deleted.

1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto eol=lf
9 changes: 6 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:

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

steps:
- uses: actions/checkout@v3
Expand All @@ -22,5 +22,8 @@ jobs:
with:
node-version: ${{ matrix.node-version }}

- run: npm install
- run: npm run ci
- name: Install pnpm
uses: pnpm/action-setup@v2

- run: pnpm install
- run: pnpm run ci
72 changes: 72 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
import js from '@eslint/js';
import pluginImport from 'eslint-plugin-import-x';
import pluginNode from 'eslint-plugin-n';
import configPrettier from 'eslint-config-prettier';

export default [
{
ignores: ['packages/eslint-plugin-ecmascript-compat-example/*'],
},
pluginNode.configs['flat/recommended-module'],
{
languageOptions: {
parserOptions: {
ecmaVersion: 2022,
sourceType: 'module',
},
sourceType: 'module',
},
plugins: {
'import-x': pluginImport,
},
rules: {
...js.configs.all.rules,
...configPrettier.rules,
'capitalized-comments': 'off',
'global-require': 'off',
'init-declarations': 'off',
'line-comment-position': 'off',
'multiline-comment-style': 'off',
'no-eq-null': 'off',
'no-inline-comments': 'off',
'no-magic-numbers': 'off',
'no-plusplus': 'off',
'no-ternary': 'off',
'no-undefined': 'off',
'one-var': 'off',
'sort-imports': 'off', // using import/order instead
'sort-keys': 'off',
strict: 'off',

// eslint:all - Modify default options
eqeqeq: ['error', 'always', { null: 'never' }],
'func-names': ['error', 'as-needed'],
'func-style': ['error', 'declaration'],
'id-length': ['error', { exceptions: ['_', 'a', 'b', 'i'] }],
'no-unused-vars': ['error', { ignoreRestSiblings: true }],
'no-use-before-define': ['error', 'nofunc'],
'spaced-comment': ['error', 'always', { block: { balanced: true } }],

// eslint:all & prettier - Re-enable some of the rules
// that are compatible when certain options are used
// (https://github.com/prettier/eslint-config-prettier#special-rules)
curly: 'error',
'max-len': ['error', { code: 1000, comments: 90, ignoreUrls: true }],
quotes: ['error', 'single', { avoidEscape: true, allowTemplateLiterals: false }],

// eslint:all - Rules whose default options do nothing.
// Options need to be compatible with Prettier.
'padding-line-between-statements': [
'error',
{ blankLine: 'always', prev: '*', next: ['cjs-export'] },

{ blankLine: 'always', prev: '*', next: 'block-like' },
{ blankLine: 'always', prev: 'block-like', next: '*' },
],

'import-x/newline-after-import': 'error',
'import-x/no-extraneous-dependencies': 'error',
'import-x/order': ['error', { 'newlines-between': 'never' }],
},
},
];
4 changes: 1 addition & 3 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
{
"packages": [
"packages/*"
],
"npmClient": "pnpm",
"version": "3.2.1"
}
Loading