-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated eslint config to new format. Removed Node 16 from publish tes…
…ts as thet is now EoL
- Loading branch information
1 parent
d919b67
commit 2d932c2
Showing
6 changed files
with
131 additions
and
118 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
import globals from "globals"; | ||
import path from "node:path"; | ||
import { fileURLToPath } from "node:url"; | ||
import js from "@eslint/js"; | ||
import { FlatCompat } from "@eslint/eslintrc"; | ||
|
||
const __filename = fileURLToPath(import.meta.url); | ||
const __dirname = path.dirname(__filename); | ||
const compat = new FlatCompat({ | ||
baseDirectory: __dirname, | ||
recommendedConfig: js.configs.recommended, | ||
allConfig: js.configs.all | ||
}); | ||
|
||
export default [...compat.extends("eslint:recommended"), { | ||
languageOptions: { | ||
globals: { | ||
...globals.node, | ||
it: false, | ||
describe: false, | ||
}, | ||
|
||
ecmaVersion: 2020, | ||
sourceType: "module", | ||
|
||
parserOptions: { | ||
ecmaFeatures: { | ||
impliedStrict: true, | ||
}, | ||
|
||
allowImportExportEverywhere: true, | ||
}, | ||
}, | ||
|
||
rules: { | ||
"no-eval": "error", | ||
"no-implied-eval": "error", | ||
"dot-notation": "error", | ||
eqeqeq: ["error", "smart"], | ||
"no-caller": "error", | ||
"no-extra-bind": "error", | ||
"no-unused-expressions": "error", | ||
"no-useless-call": "error", | ||
"no-useless-return": "error", | ||
radix: "warn", | ||
|
||
"no-unused-vars": ["error", { | ||
args: "none", | ||
vars: "all", | ||
}], | ||
|
||
"no-empty": ["error", { | ||
allowEmptyCatch: true, | ||
}], | ||
|
||
"no-control-regex": "off", | ||
"require-atomic-updates": "off", | ||
"no-async-promise-executor": "off", | ||
"brace-style": ["error", "1tbs"], | ||
"block-spacing": "error", | ||
"array-bracket-spacing": "error", | ||
"comma-spacing": "error", | ||
"comma-style": "error", | ||
"computed-property-spacing": "error", | ||
"no-trailing-spaces": "warn", | ||
"eol-last": "error", | ||
"func-call-spacing": "error", | ||
|
||
"key-spacing": ["warn", { | ||
mode: "minimum", | ||
}], | ||
|
||
indent: ["error", 4, { | ||
ignoreComments: true, | ||
ArrayExpression: "first", | ||
SwitchCase: 1, | ||
}], | ||
|
||
"linebreak-style": ["error", "unix"], | ||
|
||
quotes: ["error", "double", { | ||
avoidEscape: true, | ||
}], | ||
|
||
camelcase: ["error", { | ||
properties: "always", | ||
}], | ||
|
||
semi: ["error", "always"], | ||
"unicode-bom": "error", | ||
|
||
"keyword-spacing": ["error", { | ||
before: true, | ||
after: true, | ||
}], | ||
|
||
"no-multiple-empty-lines": ["warn", { | ||
max: 2, | ||
maxEOF: 1, | ||
maxBOF: 0, | ||
}], | ||
|
||
"no-whitespace-before-property": "error", | ||
"operator-linebreak": ["error", "after"], | ||
"space-in-parens": "error", | ||
"no-var": "error", | ||
"prefer-const": "error", | ||
}, | ||
}, { | ||
files: ["test/**/*"], | ||
|
||
rules: { | ||
"no-unused-expressions": "off", | ||
"no-console": "off", | ||
}, | ||
}]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
import app from "./src/app.mjs" | ||
import app from "./src/app.mjs"; | ||
|
||
|
||
const port = process.env.PORT || 3000; | ||
|
||
app.listen(port, function () { | ||
console.log(`CyberChef Server listening on port ${port}!`); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,26 @@ | ||
import { exec } from 'node:child_process'; | ||
import { exec } from "node:child_process"; | ||
|
||
switch (process.platform) { | ||
case "darwin": | ||
exec(`find ./node_modules/crypto-api/src/ \\( -type d -name .git -prune \\) -o -type f -print0 | xargs -0 sed -i '' -e '/\\.mjs/!s/\\(from "\\.[^"]*\\)";/\\1.mjs";/g'`); | ||
exec("find ./node_modules/crypto-api/src/ \\( -type d -name .git -prune \\) -o -type f -print0 | xargs -0 sed -i '' -e '/\\.mjs/!s/\\(from \"\\.[^\"]*\\)\";/\\1.mjs\";/g'"); | ||
break; | ||
default: | ||
exec(`find ./node_modules/crypto-api/src/ \\( -type d -name .git -prune \\) -o -type f -print0 | xargs -0 sed -i -e '/\\.mjs/!s/\\(from "\\.[^"]*\\)";/\\1.mjs";/g'`); | ||
exec("find ./node_modules/crypto-api/src/ \\( -type d -name .git -prune \\) -o -type f -print0 | xargs -0 sed -i -e '/\\.mjs/!s/\\(from \"\\.[^\"]*\\)\";/\\1.mjs\";/g'"); | ||
} | ||
|
||
switch (process.platform) { | ||
case "darwin": | ||
exec(`sed -i '' 's/<div id=snackbar-container\\/>/<div id=snackbar-container>/g' ./node_modules/snackbarjs/src/snackbar.js`); | ||
exec("sed -i '' 's/<div id=snackbar-container\\/>/<div id=snackbar-container>/g' ./node_modules/snackbarjs/src/snackbar.js"); | ||
break; | ||
default: | ||
exec(`sed -i 's/<div id=snackbar-container\\/>/<div id=snackbar-container>/g' ./node_modules/snackbarjs/src/snackbar.js`); | ||
exec("sed -i 's/<div id=snackbar-container\\/>/<div id=snackbar-container>/g' ./node_modules/snackbarjs/src/snackbar.js"); | ||
} | ||
|
||
switch (process.platform) { | ||
case "darwin": | ||
// Space added before comma to prevent multiple modifications | ||
exec(`sed -i '' 's/"es\\/index.js",/"es\\/index.js" ,\\n "type": "module",/' ./node_modules/jimp/package.json`); | ||
exec("sed -i '' 's/\"es\\/index.js\",/\"es\\/index.js\" ,\\n \"type\": \"module\",/' ./node_modules/jimp/package.json"); | ||
break; | ||
default: | ||
exec(`sed -i 's/"es\\/index.js",/"es\\/index.js" ,\\n "type": "module",/' ./node_modules/jimp/package.json`); | ||
} | ||
exec("sed -i 's/\"es\\/index.js\",/\"es\\/index.js\" ,\\n \"type\": \"module\",/' ./node_modules/jimp/package.json"); | ||
} |