Skip to content
Merged
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
33 changes: 0 additions & 33 deletions .eslintrc

This file was deleted.

8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v4
with:
node-version: '20'
node-version: '22'
- name: Cache node_modules
uses: actions/cache@v4
env:
Expand All @@ -35,7 +35,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
node: ['20', '18']
node: ['22', '20']
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v4
Expand All @@ -58,7 +58,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v4
with:
node-version: '20'
node-version: '22'
- name: Cache node_modules
uses: actions/cache@v4
env:
Expand All @@ -80,7 +80,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v4
with:
node-version: '20'
node-version: '22'
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: npm run build
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20
22
74 changes: 74 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
import js from '@eslint/js';
import tsPlugin from '@typescript-eslint/eslint-plugin';
import tsParser from '@typescript-eslint/parser';
import prettierRecommended from 'eslint-plugin-prettier/recommended';
import security from 'eslint-plugin-security';
import globals from 'globals';

export default [
{
ignores: [
'dist/**',
'doc/**',
'coverage/**',
'.nyc_output/**',
// generated by `npm run generate:schemas`
'src/schemas/index.ts'
]
},

js.configs.recommended,
security.configs.recommended,

{
languageOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
globals: {
...globals.browser,
...globals.node,
...globals.mocha,
NodeJS: 'readonly'
}
},
rules: {
'no-empty': ['error', { allowEmptyCatch: true }],
'prefer-destructuring': ['warn', { object: true, array: false }],
'no-dupe-class-members': ['warn'],
'no-useless-constructor': ['warn'],
'no-unused-vars': ['warn'],
'constructor-super': ['warn'],
// carried over from eslint-config-oceanprotocol, which pulled these in
// via eslint-config-standard; both packages are eslintrc-only and were
// dropped for eslint 10's flat config
camelcase: ['warn', { properties: 'never', ignoreGlobals: true }],
'no-use-before-define': [
'warn',
{ functions: false, classes: false, variables: false }
],
// https://github.com/nodesecurity/eslint-plugin-security/issues/21
'security/detect-object-injection': 'off'
}
},

{
files: ['**/*.ts', '**/*.tsx'],
languageOptions: {
parser: tsParser,
parserOptions: {
ecmaFeatures: { jsx: false },
project: ['./tsconfig.json']
}
},
plugins: { '@typescript-eslint': tsPlugin },
rules: {
// the TS compiler already reports these, and the core rules produce
// false positives on type-only and overload declarations
'no-unused-vars': 'off',
'no-undef': 'off',
'@typescript-eslint/no-unused-vars': ['warn']
}
},

prettierRecommended
];
Loading
Loading