Skip to content
Open
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
20 changes: 20 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { defineConfig } from "eslint/config";
import globals from "globals";

export default defineConfig([{
languageOptions: {
globals: {
...globals.node,
},
},

rules: {
"no-undef": "error",
"no-unused-vars": ["error", { "caughtErrors": "none" }],
"eol-last": "error",
"dot-notation": "error",
"no-empty": ["error", {
allowEmptyCatch: true,
}],
},
}]);
4 changes: 2 additions & 2 deletions lib/handlers.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ var _uniq = require('underscore').uniq;
// Mitigates prototype pollution and constructor escape attacks.
var UNSAFE_PROPERTY_NAMES = Object.create(null);

/* jshint -W069: true */
/* eslint-disable dot-notation */
UNSAFE_PROPERTY_NAMES['constructor'] = true;
UNSAFE_PROPERTY_NAMES['__proto__'] = true;
UNSAFE_PROPERTY_NAMES['prototype'] = true;
/* jshint -W069: false */
/* eslint-enable dot-notation */

function isUnsafePropertyName(name) {
return typeof name === 'string' && UNSAFE_PROPERTY_NAMES[name] === true;
Expand Down
2 changes: 1 addition & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ JSONPath.prototype.parent = function(obj, string) {

var node = this.nodes(obj, string)[0];
if (node) this._assert_safe_path_keys(node.path);
var key = node.path.pop(); /* jshint unused:false */
var key = node.path.pop(); /* eslint-disable-line no-unused-vars */
return this.value(obj, node.path);
}

Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"author": "david@fmail.co.uk",
"scripts": {
"prepublishOnly": "node lib/aesprim.js > generated/aesprim-browser.js",
"test": "mocha -u tdd test && jshint lib",
"test": "mocha -u tdd test && eslint lib",
"generate": "node bin/generate_parser.js > generated/parser.js"
},
"dependencies": {
Expand All @@ -18,13 +18,14 @@
"./lib/aesprim.js": "./generated/aesprim-browser.js"
},
"devDependencies": {
"eslint": "10.4.0",
"globals": "17.6.0",
"grunt": "0.4.5",
"grunt-browserify": "3.8.0",
"grunt-cli": "0.1.13",
"grunt-contrib-uglify": "0.9.1",
"jison": "0.4.13",
"jscs": "1.10.0",
"jshint": "2.6.0",
"mocha": "2.1.0"
},
"repository": {
Expand Down