Skip to content

Commit

Permalink
Fix eslint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
fkling committed Sep 24, 2019
1 parent 357a231 commit d5dd830
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
1 change: 1 addition & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ rules:
import/namespace: "error"
import/export: "error"
require-in-package/require-in-package: "error"
react/display-name: off

settings:
import/resolver: "webpack"
Expand Down
18 changes: 9 additions & 9 deletions website/src/parsers/html/transformers/svelte/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,28 +22,28 @@ export default {
const transform = compileModule(transformCode);

// Identity functions in case of missing transforms
const _markupIdentity = (content, filename) => content;
const _scriptIdentity = (content, attributes, filename) => content;
const _styleIdentity = (content, attributes, filename) => content;
const _markupIdentity = (content, _filename) => content;
const _scriptIdentity = (content, _attributes, _filename) => content;
const _styleIdentity = (content, _attributes, _filename) => content;

// Check if there is a transform
// If Yes, set the appropriate transform or else use identity functions
const markupTransform = transform().markup || _markupIdentity;
// Check if there is a transform
// If Yes, set the appropriate transform or else use identity functions
const markupTransform = transform().markup || _markupIdentity;
const scriptTransform = transform().script || _scriptIdentity;
const styleTransform = transform().style || _styleIdentity;

const result = preprocess(code, {
markup:({ content, filename}) => {
markup:({ content, _filename}) => {
return {
code: markupTransform(content),
};
},
script: ({content, attributes, filename}) => {
script: ({content, attributes, _filename}) => {
return {
code: scriptTransform(content, attributes),
};
},
style: ({content, attributes, filename}) => {
style: ({content, attributes, _filename}) => {
return {
code: styleTransform(content, attributes),
};
Expand Down

0 comments on commit d5dd830

Please sign in to comment.