mirror of
https://github.com/benjaminion/upgrading-ethereum-book.git
synced 2026-01-09 14:38:08 -05:00
Use eslint
This commit is contained in:
26
eslint.config.js
Normal file
26
eslint.config.js
Normal file
@@ -0,0 +1,26 @@
|
||||
import js from '@eslint/js';
|
||||
import globals from 'globals';
|
||||
import css from '@eslint/css';
|
||||
import { defineConfig } from 'eslint/config';
|
||||
|
||||
export default defineConfig([
|
||||
{
|
||||
files: ['**/*.{js,mjs,cjs}'],
|
||||
plugins: { js },
|
||||
extends: ['js/recommended'],
|
||||
},
|
||||
{
|
||||
files: ['**/*.{js,mjs,cjs}'],
|
||||
languageOptions: { globals: { ...globals.browser, ...globals.node } },
|
||||
},
|
||||
{
|
||||
rules: {
|
||||
'no-unused-vars': [
|
||||
'error',
|
||||
{
|
||||
caughtErrors: 'none',
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
]);
|
||||
@@ -1,4 +1,5 @@
|
||||
import { visit } from 'unist-util-visit';
|
||||
import fs from 'fs';
|
||||
|
||||
// Add a tooltip to constant values in the text according to the mapping in the
|
||||
// supplied file.
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import fs from 'fs';
|
||||
|
||||
// Write a .htaccess file to set the correct 404 page
|
||||
|
||||
function writeHtaccess(base, dir, logger) {
|
||||
|
||||
@@ -8,7 +8,7 @@ const searchIndex = [];
|
||||
function isExcludedFrontmatter(frontmatter, exclude) {
|
||||
for (let i = 0; i < exclude.frontmatter.length; i++) {
|
||||
const test = exclude.frontmatter[i];
|
||||
const [key, ...rest] = Object.keys(test);
|
||||
const key = Object.keys(test)[0];
|
||||
if (
|
||||
Object.prototype.hasOwnProperty.call(frontmatter, key) &&
|
||||
frontmatter[key] == test[key]
|
||||
|
||||
@@ -2,6 +2,7 @@ import { visit } from 'unist-util-visit';
|
||||
import { optimize } from 'svgo';
|
||||
import { getHashDigest } from 'loader-utils';
|
||||
import path from 'path';
|
||||
import fs from 'fs';
|
||||
|
||||
// Inline SVG files into the Markdown AST
|
||||
|
||||
|
||||
967
package-lock.json
generated
967
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -34,5 +34,10 @@
|
||||
"rehype-katex": "^7.0.1",
|
||||
"remark-math": "^6.0.0",
|
||||
"svgo": "^4.0.0-rc.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/js": "^9.27.0",
|
||||
"eslint": "^9.27.0",
|
||||
"globals": "^16.1.0"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user