Skip to content

Commit 65136a3

Browse files
authored
chore: npm run format (#106)
* chore: npm run format * fix .eslint-doc-generatorrc.js
1 parent 4294d29 commit 65136a3

16 files changed

+62
-67
lines changed

.eslint-doc-generatorrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
const { format } = require('prettier');
2-
const { prettier: prettierRC } = require('./.prettierrc.json');
2+
const prettierRC = require('./.prettierrc.json');
33

44
/** @type {import('eslint-doc-generator').GenerateOptions} */
55
const config = {

.eslintrc

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
{
2-
"extends": [
3-
"eslint:recommended",
4-
"prettier",
5-
"plugin:eslint-plugin/recommended"
6-
],
2+
"extends": ["eslint:recommended", "prettier", "plugin:eslint-plugin/recommended"],
73
"parserOptions": {
84
"ecmaVersion": "latest"
95
},
@@ -17,11 +13,10 @@
1713
"eslint-plugin/require-meta-docs-url": [
1814
"error",
1915
{
20-
"pattern":
21-
"https://github.com/eslint-community/eslint-plugin-security/blob/main/docs/rules/{{name}}.md",
22-
},
16+
"pattern": "https://github.com/eslint-community/eslint-plugin-security/blob/main/docs/rules/{{name}}.md"
17+
}
2318
],
2419
"eslint-plugin/require-meta-schema": "off", // TODO: enable
25-
"eslint-plugin/require-meta-type": "off"// TODO: enable
20+
"eslint-plugin/require-meta-type": "off" // TODO: enable
2621
}
2722
}

.markdownlint.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"line-length": false,
3-
"no-inline-html": { "allowed_elements": ["kbd"]}
3+
"no-inline-html": { "allowed_elements": ["kbd"] }
44
}

CHANGELOG.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
- 1.5.0
44
- Fix avoid crash when exec() is passed no arguments
5-
Closes [#82](https://github.com/nodesecurity/eslint-plugin-security/pull/82) with ref as [#23](https://github.com/nodesecurity/eslint-plugin-security/pull/23)
5+
Closes [#82](https://github.com/nodesecurity/eslint-plugin-security/pull/82) with ref as [#23](https://github.com/nodesecurity/eslint-plugin-security/pull/23)
66
- Fix incorrect method name in detect-buffer-noassert
77
Closes [#63](https://github.com/nodesecurity/eslint-plugin-security/pull/63) and [#80](https://github.com/nodesecurity/eslint-plugin-security/pull/80)
88
- Clean up source code formatting
@@ -17,8 +17,8 @@
1717
- Fix linting errors and step
1818
[Lint errors](https://github.com/nodesecurity/eslint-plugin-security/commit/1258118c2d07722e9fb388a672b287bb43bc73b3), [Lint step](https://github.com/nodesecurity/eslint-plugin-security/commit/84f3ed3ab88427753c7ac047d0bccbe557f28aa5)
1919
- Create workflows
20-
Check commit message on pull requests, Set up ci on main branch
21-
- Update test and lint commands to work cross-platform
20+
Check commit message on pull requests, Set up ci on main branch
21+
- Update test and lint commands to work cross-platform
2222
[Commit](https://github.com/nodesecurity/eslint-plugin-security/commit/d3d8e7a27894aa3f83b560f530eb49750e9ee19a)
2323
- Merge pull request [#47](https://github.com/nodesecurity/eslint-plugin-security/pull/47) from pdehaan/add-docs
2424
Add old liftsecurity blog posts to docs/ folder

docs/rules/detect-bidi-characters.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ As an example, take the following code where `RLO`, `LRI`, `PDI`, `IRI` are plac
1717
```js
1818
#!/usr/bin/env node
1919

20-
var accessLevel = "user";
20+
var accessLevel = 'user';
2121

22-
if (accessLevel != "userRLO LRI// Check if adminPDI IRI") {
23-
console.log("You are an admin.");
22+
if (accessLevel != 'userRLO LRI// Check if adminPDI IRI') {
23+
console.log('You are an admin.');
2424
}
2525
```
2626

@@ -29,11 +29,11 @@ The code above, will be rendered by a text editor as follows:
2929
```js
3030
#!/usr/bin/env node
3131

32-
var accessLevel = "user";
32+
var accessLevel = 'user';
3333

34-
if (accessLevel != "user") {
34+
if (accessLevel != 'user') {
3535
// Check if admin
36-
console.log("You are an admin.");
36+
console.log('You are an admin.');
3737
}
3838
```
3939

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"scripts": {
77
"changelog": "changelog eslint-plugin-security all > CHANGELOG.md",
88
"cont-int": "npm test && npm run lint",
9-
"format": "prettier --write **/*.{md,js,yml}",
9+
"format": "prettier --write .",
1010
"lint": "npm-run-all \"lint:*\"",
1111
"lint:docs": "markdownlint \"**/*.md\"",
1212
"lint:eslint-docs": "npm run update:eslint-docs -- --check",

test/detect-disable-mustache-escape.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ tester.run(ruleName, require(`../rules/${ruleName}`), {
1010
invalid: [
1111
{
1212
code: 'a.escapeMarkup = false',
13-
errors: [{ message: 'Markup escaping disabled.' }]
14-
}
15-
]
13+
errors: [{ message: 'Markup escaping disabled.' }],
14+
},
15+
],
1616
});

test/detect-eval-with-expression.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ const tester = new RuleTester();
66
const ruleName = 'detect-eval-with-expression';
77

88
tester.run(ruleName, require(`../rules/${ruleName}`), {
9-
valid: [{ code: 'eval(\'alert()\')' }],
9+
valid: [{ code: "eval('alert()')" }],
1010
invalid: [
1111
{
1212
code: 'eval(a);',
13-
errors: [{ message: 'eval with argument of type Identifier' }]
14-
}
15-
]
13+
errors: [{ message: 'eval with argument of type Identifier' }],
14+
},
15+
],
1616
});

test/detect-new-buffer.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ const ruleName = 'detect-new-buffer';
77
const invalid = 'var a = new Buffer(c)';
88

99
tester.run(ruleName, require(`../rules/${ruleName}`), {
10-
valid: [{ code: 'var a = new Buffer(\'test\')' }],
10+
valid: [{ code: "var a = new Buffer('test')" }],
1111
invalid: [
1212
{
1313
code: invalid,
14-
errors: [{ message: 'Found new Buffer' }]
15-
}
16-
]
14+
errors: [{ message: 'Found new Buffer' }],
15+
},
16+
],
1717
});

test/detect-no-csrf-before-method-override.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ tester.run(ruleName, require(`../rules/${ruleName}`), {
1010
invalid: [
1111
{
1212
code: 'express.csrf();express.methodOverride()',
13-
errors: [{ message: 'express.csrf() middleware found before express.methodOverride()' }]
14-
}
15-
]
13+
errors: [{ message: 'express.csrf() middleware found before express.methodOverride()' }],
14+
},
15+
],
1616
});

0 commit comments

Comments
 (0)