Skip to content

Commit

Permalink
Include stylelint disabling comment in header.
Browse files Browse the repository at this point in the history
Ignore JSON directory of token output.
  • Loading branch information
peterlenahan-apollo committed Oct 10, 2024
1 parent 70a43c2 commit f9b9fc3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
node_modules
.env
tokens_new/
dist/
5 changes: 4 additions & 1 deletion src/tokens_to_css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,12 @@ async function readTokensFileAndWriteToCssFile(filePath: string) {
console.log(`\u2705 Wrote ${outfileName}`);
}

const OUTPUT_HEADER = `/* This file is an autogenerated export from the Figma API */
/* stylelint-disable apollo-stylelint-plugin/prefer-css-variables -- This sheet defines variables and should not be linted with this rule. */`;

// Take an array of lines and write it as a CSS File
function writeCssToFile(outfileName: string, css: string[], rootSelector: string = ':root') {
const outfileData = `/* This file is an autogenerated export from the Figma API */\n\n${rootSelector} {\n${css.map(line => indentLine(line)).join('\n')}\n}`;
const outfileData = `${OUTPUT_HEADER}\n\n${rootSelector} {\n${css.map(line => indentLine(line)).join('\n')}\n}`;
return fs.writeFile(outfileName, outfileData);
}

Expand Down

0 comments on commit f9b9fc3

Please sign in to comment.