Skip to content

Commit

Permalink
Merge pull request #931 from basecamp/decaffeinate-unit-tests
Browse files Browse the repository at this point in the history
Decaffeinate unit tests
  • Loading branch information
Alberto Fernández-Capel authored Dec 6, 2021
2 parents e0f4a0a + 4d5f635 commit 5017e91
Show file tree
Hide file tree
Showing 42 changed files with 2,586 additions and 37,931 deletions.
37 changes: 37 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"parser": "babel-eslint",
"extends": "eslint:recommended",
"rules": {
"array-bracket-spacing": ["error", "always"],
"block-spacing": ["error", "always"],
"camelcase": ["error"],
"comma-spacing": ["error"],
"curly": ["error", "multi-line"],
"dot-notation": ["error"],
"eol-last": ["error"],
"getter-return": ["error"],
"id-length": ["error", { "properties": "never", "exceptions": ["_", "i", "n"] }],
"keyword-spacing": ["error"],
"no-extra-parens": ["error"],
"no-multi-spaces": ["error", { "exceptions": { "VariableDeclarator": true } }],
"no-multiple-empty-lines": ["error", { "max": 2 }],
"no-restricted-globals": ["error", "event"],
"no-trailing-spaces": ["error"],
"no-unused-vars": ["error", { "vars": "all", "args": "none" }],
"no-var": ["error"],
"object-curly-spacing": ["error", "always"],
"prefer-const": ["error"],
"quotes": ["error", "double"],
"semi": ["error", "never"],
"sort-imports": ["error", { "ignoreDeclarationSort": true }]
},
"ignorePatterns": ["dist/**/*.js", "**/vendor/**/*.js"],
"globals": {
"Trix": true
},
"env": {
"browser": true,
"node": true,
"es6": true
}
}
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.rbenv-vars
yarn-error.log
package-lock.json
/dist
/node_modules
/tmp
10 changes: 5 additions & 5 deletions assets/trix/stylesheets/functions.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
const path = require('path')
const fs = require('fs')
const path = require("path")
const fs = require("fs")
const sass = require("node-sass")
const { optimize } = require('svgo')
const { optimize } = require("svgo")

const types = sass.types
const basePath = "./assets/"

module.exports = {
'svg($svgFileName)': function (svgFileName) {
"svg($svgFileName)": function (svgFileName) {
const filename = path.resolve(basePath, svgFileName.getValue())

let svgContent = fs.readFileSync(filename, "utf8")
svgContent = optimize(svgContent, { multipass: true, datauri: 'enc' })
svgContent = optimize(svgContent, { multipass: true, datauri: "enc" })

return new types.String(`url("${svgContent.data}")`)
}
Expand Down
14 changes: 14 additions & 0 deletions babel.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"presets": [
["@babel/preset-env",
{
"targets": {
"chrome": "80",
"safari": "12.1",
"edge": "80",
"firefox": "72"
}
}
]
]
}
59 changes: 0 additions & 59 deletions dist/index.html

This file was deleted.

11 changes: 0 additions & 11 deletions dist/test.html

This file was deleted.

Loading

0 comments on commit 5017e91

Please sign in to comment.