mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-18 19:25:48 +00:00
Switch to using `@noble/hashes`, `@noble/curves`, `@scure/base`, `@scure/bip32`, and `@scure/bip39`. This replaces `crypto` polyfills (such as `crypto-browserify`), `create-hash`, `elliptic`, `hash.js`, `bn.js` (both versions), and their many dependencies. This also means there are 33 less dependencies downloaded when running a fresh `npm install` and will make the project much easier to maintain. This reduces the bundle size by 44% (82kb minified and gzipped) over the current 3.0 branch as well as reducing the amount of configuration required to bundle. Closes #1814, #1817, #2272, and #2306 Co-authored-by: Caleb Kniffen <ckniffen@ripple.com>
76 lines
2.7 KiB
JavaScript
76 lines
2.7 KiB
JavaScript
module.exports = {
|
|
root: false,
|
|
|
|
parser: '@typescript-eslint/parser', // Make ESLint compatible with TypeScript
|
|
parserOptions: {
|
|
// Enable linting rules with type information from our tsconfig
|
|
tsconfigRootDir: __dirname,
|
|
project: ['./tsconfig.json', './tsconfig.eslint.json'],
|
|
|
|
sourceType: 'module', // Allow the use of imports / ES modules
|
|
|
|
ecmaFeatures: {
|
|
impliedStrict: true, // Enable global strict mode
|
|
},
|
|
},
|
|
|
|
// Specify global variables that are predefined
|
|
env: {
|
|
browser: true, // Enable browser global variables
|
|
node: true, // Enable node global variables & Node.js scoping
|
|
es2020: true, // Add all ECMAScript 2020 globals and automatically set the ecmaVersion parser option to ES2020
|
|
jest: true, // Add Jest testing global variables
|
|
},
|
|
|
|
plugins: [],
|
|
extends: ['@xrplf/eslint-config/base'],
|
|
|
|
rules: {
|
|
// ** TODO **
|
|
// all of the below are turned off for now during the migration to a
|
|
// monorepo. They need to actually be addressed!
|
|
// **
|
|
'@typescript-eslint/no-unsafe-assignment': 'off',
|
|
'@typescript-eslint/no-unsafe-member-access': 'off',
|
|
'@typescript-eslint/no-unsafe-call': 'off',
|
|
'@typescript-eslint/no-magic-numbers': 'off',
|
|
'@typescript-eslint/ban-types': 'off',
|
|
'@typescript-eslint/restrict-plus-operands': 'off',
|
|
'@typescript-eslint/no-unsafe-return': 'off',
|
|
'@typescript-eslint/explicit-module-boundary-types': 'off',
|
|
'@typescript-eslint/explicit-member-accessibility': 'off',
|
|
'@typescript-eslint/promise-function-async': 'off',
|
|
'@typescript-eslint/restrict-template-expressions': 'off',
|
|
'@typescript-eslint/prefer-nullish-coalescing': 'off',
|
|
'@typescript-eslint/naming-convention': 'off',
|
|
'@typescript-eslint/no-explicit-any': 'off',
|
|
'@typescript-eslint/consistent-type-assertions': 'off',
|
|
'import/no-unused-modules': 'off',
|
|
'import/prefer-default-export': 'off',
|
|
'jsdoc/require-jsdoc': 'off',
|
|
'jsdoc/require-description': 'off',
|
|
'jsdoc/require-returns': 'off',
|
|
'jsdoc/require-description-complete-sentence': 'off',
|
|
'jsdoc/check-tag-names': 'off',
|
|
'jsdoc/check-examples': 'off', // Not implemented in eslint 8
|
|
'jsdoc/no-types': 'off',
|
|
'tsdoc/syntax': 'off',
|
|
'import/order': 'off',
|
|
'eslint-comments/require-description': 'off',
|
|
'no-shadow': 'off',
|
|
'multiline-comment-style': 'off',
|
|
'@typescript-eslint/no-require-imports': 'off',
|
|
},
|
|
|
|
overrides: [
|
|
{
|
|
files: ['test/*.test.ts'],
|
|
// tests are importing through full module name to test in an isomorphic way
|
|
rules: {
|
|
'node/no-extraneous-import': 'off',
|
|
'import/no-extraneous-dependencies': 'off',
|
|
},
|
|
},
|
|
],
|
|
}
|