Skip to content

Commit

Permalink
Refactor development (#58)
Browse files Browse the repository at this point in the history
  • Loading branch information
cuth authored Mar 2, 2020
1 parent f5d9898 commit 5020609
Show file tree
Hide file tree
Showing 13 changed files with 3,030 additions and 612 deletions.
7 changes: 1 addition & 6 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,9 @@ root = true

[*]
indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8
indent_size = 2
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false

[*.json]
indent_size = 2
18 changes: 18 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
module.exports = {
env: {
commonjs: true,
es6: true,
node: true
},
extends: "eslint:recommended",
globals: {
Atomics: "readonly",
SharedArrayBuffer: "readonly"
},
parserOptions: {
ecmaVersion: 2018
},
rules: {
"no-console": 1
}
};
23 changes: 23 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Node.js CI

on: [push]

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [8.x, 10.x, 12.x]

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- run: npm run lint
- run: npm test
env:
CI: true
19 changes: 0 additions & 19 deletions .jshintrc

This file was deleted.

4 changes: 4 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"tabWidth": 2,
"useTabs": false
}
5 changes: 5 additions & 0 deletions example/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
rules: {
"no-console": 0
}
};
23 changes: 12 additions & 11 deletions example/index.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
'use strict';
"use strict";

var fs = require('fs');
var postcss = require('postcss');
var pxtorem = require('..');
var css = fs.readFileSync('main.css', 'utf8');
var options = {
replace: false
const fs = require("fs");
const postcss = require("postcss");
const pxtorem = require("..");

const css = fs.readFileSync("main.css", "utf8");
const options = {
replace: false
};
var processedCss = postcss(pxtorem(options)).process(css).css;
const processedCss = postcss(pxtorem(options)).process(css).css;

fs.writeFile('main-rem.css', processedCss, function (err) {
fs.writeFile("main-rem.css", processedCss, function(err) {
if (err) {
throw err;
}
console.log('Rem file written.');
});
console.log("Rem file written.");
});
Loading

0 comments on commit 5020609

Please sign in to comment.