mirror of
https://github.com/openpgpjs/openpgpjs.git
synced 2025-11-24 06:25:50 +00:00
* Bump the dev-dependencies group with 10 updates Bumps the dev-dependencies group with 10 updates: | Package | From | To | | --- | --- | --- | | [@eslint/js](https://github.com/eslint/eslint/tree/HEAD/packages/js) | `9.37.0` | `9.38.0` | | [@openpgp/web-stream-tools](https://github.com/openpgpjs/web-stream-tools) | `0.2.0` | `0.2.1` | | [@rollup/plugin-commonjs](https://github.com/rollup/plugins/tree/HEAD/packages/commonjs) | `28.0.7` | `28.0.9` | | [@rollup/plugin-replace](https://github.com/rollup/plugins/tree/HEAD/packages/replace) | `6.0.2` | `6.0.3` | | [@rollup/plugin-typescript](https://github.com/rollup/plugins/tree/HEAD/packages/typescript) | `12.1.4` | `12.3.0` | | [@stylistic/eslint-plugin](https://github.com/eslint-stylistic/eslint-stylistic/tree/HEAD/packages/eslint-plugin) | `5.4.0` | `5.5.0` | | [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) | `24.7.2` | `24.9.2` | | [eslint](https://github.com/eslint/eslint) | `9.37.0` | `9.38.0` | | [rollup](https://github.com/rollup/rollup) | `4.52.4` | `4.52.5` | | [typescript-eslint](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/typescript-eslint) | `8.46.1` | `8.46.2` | Updates `@eslint/js` from 9.37.0 to 9.38.0 - [Release notes](https://github.com/eslint/eslint/releases) - [Commits](https://github.com/eslint/eslint/commits/v9.38.0/packages/js) Updates `@openpgp/web-stream-tools` from 0.2.0 to 0.2.1 - [Commits](https://github.com/openpgpjs/web-stream-tools/compare/v0.2.0...v0.2.1) Updates `@rollup/plugin-commonjs` from 28.0.7 to 28.0.9 - [Changelog](https://github.com/rollup/plugins/blob/master/packages/commonjs/CHANGELOG.md) - [Commits](https://github.com/rollup/plugins/commits/commonjs-v28.0.9/packages/commonjs) Updates `@rollup/plugin-replace` from 6.0.2 to 6.0.3 - [Changelog](https://github.com/rollup/plugins/blob/master/packages/replace/CHANGELOG.md) - [Commits](https://github.com/rollup/plugins/commits/babel-v6.0.3/packages/replace) Updates `@rollup/plugin-typescript` from 12.1.4 to 12.3.0 - [Changelog](https://github.com/rollup/plugins/blob/master/packages/typescript/CHANGELOG.md) - [Commits](https://github.com/rollup/plugins/commits/typescript-v12.3.0/packages/typescript) Updates `@stylistic/eslint-plugin` from 5.4.0 to 5.5.0 - [Release notes](https://github.com/eslint-stylistic/eslint-stylistic/releases) - [Changelog](https://github.com/eslint-stylistic/eslint-stylistic/blob/main/CHANGELOG.md) - [Commits](https://github.com/eslint-stylistic/eslint-stylistic/commits/v5.5.0/packages/eslint-plugin) Updates `@types/node` from 24.7.2 to 24.9.2 - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) Updates `eslint` from 9.37.0 to 9.38.0 - [Release notes](https://github.com/eslint/eslint/releases) - [Commits](https://github.com/eslint/eslint/compare/v9.37.0...v9.38.0) Updates `rollup` from 4.52.4 to 4.52.5 - [Release notes](https://github.com/rollup/rollup/releases) - [Changelog](https://github.com/rollup/rollup/blob/master/CHANGELOG.md) - [Commits](https://github.com/rollup/rollup/compare/v4.52.4...v4.52.5) Updates `typescript-eslint` from 8.46.1 to 8.46.2 - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/typescript-eslint/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.46.2/packages/typescript-eslint) --- updated-dependencies: - dependency-name: "@eslint/js" dependency-version: 9.38.0 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: dev-dependencies - dependency-name: "@openpgp/web-stream-tools" dependency-version: 0.2.1 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: dev-dependencies - dependency-name: "@rollup/plugin-commonjs" dependency-version: 28.0.9 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: dev-dependencies - dependency-name: "@rollup/plugin-replace" dependency-version: 6.0.3 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: dev-dependencies - dependency-name: "@rollup/plugin-typescript" dependency-version: 12.3.0 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: dev-dependencies - dependency-name: "@stylistic/eslint-plugin" dependency-version: 5.5.0 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: dev-dependencies - dependency-name: "@types/node" dependency-version: 24.9.2 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: dev-dependencies - dependency-name: eslint dependency-version: 9.38.0 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: dev-dependencies - dependency-name: rollup dependency-version: 4.52.5 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: dev-dependencies - dependency-name: typescript-eslint dependency-version: 8.46.2 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: dev-dependencies ... Signed-off-by: dependabot[bot] <support@github.com> * Tests: Rollup: drop unused rollup-typescript exception It messed with the resolution of tweet-nacl for some reason, where node:crypto references weren't properly dropped. * Tests: Rollup: drop leftover requireReturnsDefault option in commonjs plugin * Fix TS errors in eslint config file --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: larabr <7375870+larabr@users.noreply.github.com>
179 lines
6.6 KiB
JavaScript
179 lines
6.6 KiB
JavaScript
// @ts-check
|
|
import eslint from '@eslint/js';
|
|
import { defineConfig, globalIgnores } from 'eslint/config';
|
|
import tseslint from 'typescript-eslint';
|
|
import globals from 'globals';
|
|
// @ts-expect-error missing types
|
|
import pluginChaiFriendly from 'eslint-plugin-chai-friendly';
|
|
import pluginImport from 'eslint-plugin-import';
|
|
import pluginStylistic from '@stylistic/eslint-plugin';
|
|
import pluginUnicorn from 'eslint-plugin-unicorn';
|
|
import pluginJSDoc from 'eslint-plugin-jsdoc';
|
|
|
|
export default defineConfig(
|
|
eslint.configs.recommended,
|
|
tseslint.configs.recommendedTypeChecked,
|
|
globalIgnores(['dist/', 'test/lib/', 'docs/', '.jsdocrc.cjs']),
|
|
{ // JSDoc-specific linting rules
|
|
files: ['src/**/!(*.d).{js,ts}'], // exclude .d.ts files
|
|
// @ts-expect-error outdated declarations
|
|
plugins: { 'jsdoc': pluginJSDoc },
|
|
rules: {
|
|
'jsdoc/require-file-overview': ['error', {
|
|
'tags': {
|
|
'access': { 'initialCommentsOnly': true, 'mustExist': true }
|
|
}
|
|
}]
|
|
}
|
|
},
|
|
{
|
|
languageOptions: {
|
|
ecmaVersion: 2022,
|
|
sourceType: 'module',
|
|
parserOptions: {
|
|
projectService: true,
|
|
tsconfigRootDir: import.meta.dirname
|
|
},
|
|
globals: {
|
|
...globals.browser,
|
|
...globals.nodeBuiltin,
|
|
...globals.mocha
|
|
}
|
|
},
|
|
settings: {
|
|
'import/resolver': {
|
|
typescript: { alwaysTryTypes: true }
|
|
}
|
|
},
|
|
plugins: {
|
|
'chai-friendly': pluginChaiFriendly,
|
|
'import': pluginImport,
|
|
'@stylistic': pluginStylistic,
|
|
'unicorn': pluginUnicorn
|
|
},
|
|
rules: {
|
|
'arrow-body-style': 'off',
|
|
'arrow-parens': ['error','as-needed'],
|
|
'class-methods-use-this': 'warn',
|
|
|
|
'comma-dangle': ['error', 'never'],
|
|
'@typescript-eslint/comma-spacing': 'off',
|
|
'consistent-return': 'off',
|
|
'default-case': 'off',
|
|
'@typescript-eslint/default-param-last': 'off',
|
|
'eol-last': ['error', 'always'],
|
|
'function-call-argument-newline': 'off',
|
|
'func-names': ['error', 'never'],
|
|
'function-paren-newline': 'off',
|
|
'global-require': 'off',
|
|
'key-spacing': 'off',
|
|
'keyword-spacing': 'error',
|
|
'max-classes-per-file': 'off',
|
|
'max-len': 'off',
|
|
'newline-per-chained-call': 'off',
|
|
'no-bitwise': 'off',
|
|
'no-continue': 'off',
|
|
'no-else-return': 'off',
|
|
'no-empty': ['error', { 'allowEmptyCatch': true }],
|
|
'no-multiple-empty-lines': ['error', { 'max': 2, 'maxEOF': 1, 'maxBOF':0 }],
|
|
'no-nested-ternary': 'warn',
|
|
'no-param-reassign': 'warn', // TODO get rid of this
|
|
'no-plusplus': 'off',
|
|
'no-restricted-syntax': ['error', 'ForInStatement', 'LabeledStatement', 'WithStatement'],
|
|
'object-curly-newline': 'off',
|
|
'@typescript-eslint/no-shadow': 'warn', // TODO get rid of this
|
|
'object-property-newline': [
|
|
'error',
|
|
{
|
|
'allowMultiplePropertiesPerLine': true
|
|
}
|
|
],
|
|
'object-shorthand': 'off',
|
|
'operator-assignment': 'off',
|
|
'operator-linebreak': [
|
|
'error',
|
|
'after'
|
|
],
|
|
'padded-blocks': 'off',
|
|
'prefer-arrow-callback': 'off',
|
|
'prefer-destructuring': 'off',
|
|
'prefer-rest-params': 'warn', // TODO get rid of this
|
|
'prefer-spread': 'warn', // TODO get rid of this
|
|
'prefer-template': 'off',
|
|
'quote-props': 'off',
|
|
'quotes': 'off', // superseded by @stylistic/quotes
|
|
'spaced-comment': 'off',
|
|
'indent': 'off',
|
|
'no-unused-vars': 'off',
|
|
'@typescript-eslint/no-unused-vars': [
|
|
'error',
|
|
{
|
|
'argsIgnorePattern': '^_'
|
|
}
|
|
],
|
|
// eslint-plugin-import rules:
|
|
'import/named': 'error',
|
|
'import/extensions': 'off', // temporary: we use them in tests (ESM compliant), but not in the lib (to limit diff)
|
|
'import/first': 'off',
|
|
'import/no-extraneous-dependencies': ['error', { 'devDependencies': true, 'optionalDependencies': false, 'peerDependencies': false }],
|
|
'import/no-unassigned-import': 'error',
|
|
'import/no-unresolved': 'error',
|
|
'import/prefer-default-export': 'off',
|
|
'import/newline-after-import': 'error',
|
|
|
|
// Custom silencers:
|
|
'no-multi-assign': 'off',
|
|
'no-underscore-dangle': 'off',
|
|
'no-await-in-loop': 'off',
|
|
'camelcase': 'off', // snake_case used in tests, need to fix separately
|
|
'@typescript-eslint/naming-convention': 'off', // supersedes 'camelcase' rule
|
|
'@typescript-eslint/lines-between-class-members': 'off',
|
|
'@typescript-eslint/no-explicit-any': 'off',
|
|
'@typescript-eslint/no-this-alias': 'off',
|
|
|
|
// Custom errors:
|
|
'@typescript-eslint/no-use-before-define': ['error', { 'functions': false, 'classes': true, 'variables': false, 'allowNamedExports': true }],
|
|
'no-constant-condition': [2, { 'checkLoops': false }],
|
|
'new-cap': ['error', {
|
|
properties: false,
|
|
newIsCap: true,
|
|
newIsCapExceptions: [],
|
|
capIsNew: false
|
|
}],
|
|
'max-lines': [2, { 'max': 620, 'skipBlankLines': true, 'skipComments': true }],
|
|
'@typescript-eslint/no-unused-expressions': 'off',
|
|
'chai-friendly/no-unused-expressions': ['error', { 'allowShortCircuit': true }],
|
|
'@typescript-eslint/no-empty-object-type': ['error', { allowInterfaces: 'with-single-extends' }],
|
|
'no-invalid-this': 'error',
|
|
'require-await': 'off', // superseded by @typescript-eslint/require-await
|
|
|
|
'@typescript-eslint/no-unsafe-call': 'off', // function call to fn with `any` type
|
|
'@typescript-eslint/no-unsafe-member-access': 'off',
|
|
'@typescript-eslint/no-unsafe-argument': 'off',
|
|
'@typescript-eslint/no-unsafe-assignment': 'off',
|
|
'@typescript-eslint/no-unsafe-return': 'off',
|
|
'@typescript-eslint/restrict-template-expressions': 'off',
|
|
'prefer-promise-reject-errors': 'off',
|
|
'@typescript-eslint/prefer-promise-reject-errors': 'off',
|
|
|
|
'@stylistic/indent': ['error', 2, { 'SwitchCase': 1 }],
|
|
'@stylistic/quotes': ['error', 'single', { avoidEscape: true }],
|
|
'@stylistic/space-before-function-paren': ['error', { 'anonymous': 'ignore', 'named': 'never', 'asyncArrow': 'always' }],
|
|
'@stylistic/no-mixed-operators': ['error', {
|
|
allowSamePrecedence: true,
|
|
groups: [
|
|
['==', '!=', '===', '!==', '>', '>=', '<', '<='],
|
|
['&&', '||']
|
|
]
|
|
}],
|
|
'@stylistic/no-mixed-spaces-and-tabs': 'error',
|
|
'@stylistic/eol-last': 'error',
|
|
'@stylistic/no-trailing-spaces': 'error',
|
|
'@stylistic/no-tabs': 'error',
|
|
'unicorn/switch-case-braces': ['error', 'avoid'],
|
|
'no-console': 'warn',
|
|
'no-process-exit': 'error'
|
|
}
|
|
}
|
|
);
|