Skip to content

Commit

Permalink
Merge pull request #33 from Stassi/feature/eslint-plugin-no-unsanitized
Browse files Browse the repository at this point in the history
feature/eslint-plugin-no-unsanitized
  • Loading branch information
Stassi authored Sep 28, 2024
2 parents b7328d7 + 5db014c commit 8c9e174
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 3 deletions.
8 changes: 8 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,14 @@ module.exports = {
],
},
},
{
files: ['*.js', '*.ts'],
plugins: ['no-unsanitized'],
rules: {
'no-unsanitized/method': 'error',
'no-unsanitized/property': 'error',
},
},
],
parser: '@babel/eslint-parser',
parserOptions: {
Expand Down
15 changes: 13 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@stassi/leaf",
"version": "0.0.32",
"version": "0.0.33",
"description": "Leaflet adapter.",
"keywords": [
"cartography",
Expand Down Expand Up @@ -76,6 +76,7 @@
"eslint-plugin-import": "^2.30.0",
"eslint-plugin-jest": "^28.8.3",
"eslint-plugin-jsonc": "^2.16.0",
"eslint-plugin-no-unsanitized": "^4.1.1",
"eslint-plugin-prettier": "^5.2.1",
"expect-puppeteer": "^10.1.1",
"jest": "^29.7.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export function domElement({ name, style }) {
},
element,
setInnerHtml(innerHtml) {
// eslint-disable-next-line no-unsanitized/property -- TODO: Sanitize input
element.innerHTML = innerHtml
return innerHtml
},
Expand Down
1 change: 1 addition & 0 deletions public/tutorial/choropleth/script/choropleth.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* eslint-disable no-nested-ternary -- copied from tutorial */
/* eslint-disable no-unsanitized/property -- copied from tutorial */

import { DomUtility } from '../../../leaflet-adapter/document-object-model/dom-utility.js'
import { control } from '../../../leaflet-adapter/control/control.js'
Expand Down

0 comments on commit 8c9e174

Please sign in to comment.