Skip to content

Commit

Permalink
Fix some ESlint complaints
Browse files Browse the repository at this point in the history
  • Loading branch information
akx committed Nov 12, 2019
1 parent f6db521 commit 1719018
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 8 deletions.
6 changes: 6 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ module.exports = {
"ecmaVersion": 2018,
"sourceType": "module"
},
"globals": {
"console": false,
"context": false,
"COSAlertWindow": false,
"NSFileHandlingPanelOKButton": false
},
"rules": {
}
};
4 changes: 2 additions & 2 deletions src/getSketchData/getSvgPaths.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ if (tokenPage) {
.flat()
.filter(item => item.name.includes(iconLayerName));

getSvgPaths = iconLayers.map(({ name, id, layers }) => {
getSvgPaths = iconLayers.map(({ name, layers }) => {
let parsedSvgCode = sketch.export(layers[0], options).toString();
parsedSvgCode = parsedSvgCode
.replace("<!-- Generator: Sketch 58 (84663) - https://sketch.com -->", "")
.replace("<desc>Created with Sketch.</desc>", "")
.replace(/"/g, "'")
.replace(/\n/g, "")
.replace(/\<\?xml.+\?\>/g, "")
.replace(/<\?xml.+\?>/g, "")
.replace(/svg/, "svg id='" + name.replace(/\//, "-") + "'");
return {
name: name.replace(/\//g, "-"),
Expand Down
5 changes: 3 additions & 2 deletions src/getSketchData/getUtils.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { mainSketchFile, tokensPage, utilisGroupName, utilisLayerName, utilisAll } from "../settings";
import { map, concat, zipObject, forEach } from "lodash";
import _ from "lodash";

const sketchDom = require("sketch/dom").getDocuments();
const sketchDomSelected = require("sketch/dom").getSelectedDocument();
const [mainDocument] = sketchDom.filter(file => file.path.includes(mainSketchFile));
Expand Down Expand Up @@ -44,6 +45,6 @@ if (tokenPage) {
});
}

const getUtilis = concat(getUtilsSpace, getUtilsBorder, getUtilsShadow);
const getUtilis = _.concat(getUtilsSpace, getUtilsBorder, getUtilsShadow);

export default getUtilis;
2 changes: 1 addition & 1 deletion src/saveContentToFile.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export const saveContentToFile = async (path, file) => {
};

async function creatingTokens() {
const msg = await createFolderFiles();
await createFolderFiles();
}

switch (file) {
Expand Down
3 changes: 0 additions & 3 deletions src/settings.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
const sketchDom = require("sketch/dom").getDocuments();
const sketchDomSelected = require("sketch/dom").getSelectedDocument();

// Here are the name conventions for getting elements and layers from Sketch
export const mainSketchFile = "design-tokens";
export const tokensPage = "design-tokens";
Expand Down

0 comments on commit 1719018

Please sign in to comment.