Skip to content

Commit

Permalink
Update ESLint rules for scripts (#6081)
Browse files Browse the repository at this point in the history
Our ESLint rules have been updated to include override rules for
scripts. Scripts run in a Node.js environment where using `console.log`
is expected, so they rules against using Node.js imports and
 `console.log` did not make sense.

This allows us to remove various ESLint ignore rules that were added to
scripts.
  • Loading branch information
Gudahtt authored Mar 30, 2023
1 parent 63d3e54 commit 7a3ff93
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
8 changes: 8 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ module.exports = {
files: ['*.{ts,tsx}'],
extends: ['@metamask/eslint-config-typescript'],
},
{
files: ['scripts/**/*.js'],
rules: {
'no-console': 0,
'import/no-commonjs': 0,
'import/no-nodejs-modules': 0,
},
},
],

globals: {
Expand Down
2 changes: 1 addition & 1 deletion scripts/metamask-bot-build-announce-bitrise.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env node
// eslint-disable-next-line import/no-commonjs

const axios = require('axios');

const ANDROID_APK_LINK = process.env.BITRISE_PUBLIC_INSTALL_PAGE_URL;
Expand Down
4 changes: 1 addition & 3 deletions scripts/metamask-bot-build-generate-static-assets.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#!/usr/bin/env node
/* eslint-disable import/no-commonjs */
/* eslint-disable import/no-nodejs-modules */
/* eslint-disable no-console */

const contractMetadata = require('@metamask/contract-metadata');
const fs = require('fs');
const path = require('path');
Expand Down

0 comments on commit 7a3ff93

Please sign in to comment.