Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 0 additions & 31 deletions .eslintrc

This file was deleted.

2 changes: 1 addition & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ TODO.md
*.tgz
.nyc_output
coverage
.eslintrc
eslint.config.js
cloudformation
73 changes: 73 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
'use strict';

const js = require('@eslint/js');
const stylistic = require('@stylistic/eslint-plugin');
const n = require('eslint-plugin-n');
const globals = require('globals');

module.exports = [
{
ignores: ['coverage/']
},
js.configs.recommended,
{
files: ['**/*.js', 'bin/node-pre-gyp'],
plugins: {
'@stylistic': stylistic,
n
},
languageOptions: {
ecmaVersion: 2020,
sourceType: 'commonjs',
globals: {
...globals.node
}
},
rules: {
'no-var': 'error',
'prefer-const': 'error',
'eqeqeq': ['error', 'smart'],
'no-extend-native': 'error',
'no-use-before-define': ['error', 'nofunc'],
'strict': 'error',
'no-console': 'off',
'no-shadow': 'error',
'no-constant-condition': ['error', { checkLoops: false }],
'prefer-arrow-callback': 'error',

'n/no-unsupported-features/es-builtins': 'error',
'n/no-unsupported-features/es-syntax': 'error',
'n/no-unsupported-features/node-builtins': 'error',
'n/no-missing-require': 'error',

'@stylistic/array-bracket-spacing': ['error', 'never'],
'@stylistic/arrow-parens': ['error', 'always'],
'@stylistic/comma-dangle': ['error', 'never'],
'@stylistic/comma-spacing': 'error',
'@stylistic/computed-property-spacing': ['error', 'never'],
'@stylistic/eol-last': 'error',
'@stylistic/function-call-spacing': ['error', 'never'],
'@stylistic/indent': ['error', 2, { SwitchCase: 1 }],
'@stylistic/key-spacing': 'error',
'@stylistic/keyword-spacing': ['error', { before: true, after: true }],
'@stylistic/no-confusing-arrow': ['error', { allowParens: false }],
'@stylistic/no-mixed-spaces-and-tabs': 'error',
'@stylistic/no-trailing-spaces': 'error',
'@stylistic/object-curly-spacing': ['error', 'always'],
'@stylistic/quotes': ['error', 'single', { avoidEscape: true }],
'@stylistic/rest-spread-spacing': ['error', 'never'],
'@stylistic/semi': ['error', 'always'],
'@stylistic/semi-spacing': 'error',
'@stylistic/space-before-blocks': 'error',
'@stylistic/space-before-function-paren': ['error', {
anonymous: 'never',
named: 'never',
asyncArrow: 'always'
}],
'@stylistic/space-in-parens': ['error', 'never'],
'@stylistic/space-infix-ops': 'error',
'@stylistic/spaced-comment': ['error', 'always'],
'@stylistic/template-curly-spacing': ['error', 'never']
}
}
];
4 changes: 2 additions & 2 deletions lib/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ try {
// Read own package.json to get the current node-pre-pyp version.
const ownPackageJSON = fs.readFileSync(path.join(__dirname, '..', 'package.json'), 'utf8');
npgVersion = JSON.parse(ownPackageJSON).version;
} catch (e) {
} catch {
// do nothing
}

Expand Down Expand Up @@ -210,7 +210,7 @@ function do_build(gyp, argv, callback) {

function print_fallback_error(err, opts, package_json) {
const fallback_message = ' (falling back to source compile with node-gyp)';
let full_message = '';
let full_message;
if (err.statusCode !== undefined) {
// If we got a network response it but failed to download
// it means remote binaries are not available, so let's try to help
Expand Down
6 changes: 3 additions & 3 deletions lib/util/compile.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function which_node_gyp() {
if (existsSync(node_gyp_bin)) {
return node_gyp_bin;
}
} catch (err) {
} catch {
// do nothing
}
}
Expand All @@ -35,7 +35,7 @@ function which_node_gyp() {
if (existsSync(node_gyp_bin)) {
return node_gyp_bin;
}
} catch (err) {
} catch {
// do nothing
}
if (process.execPath.indexOf('iojs') === -1) {
Expand All @@ -47,7 +47,7 @@ function which_node_gyp() {
if (existsSync(node_gyp_bin)) {
return node_gyp_bin;
}
} catch (err) {
} catch {
// do nothing
}
}
Expand Down
Loading
Loading