Skip to content

Commit

Permalink
refactor: code
Browse files Browse the repository at this point in the history
  • Loading branch information
evilebottnawi authored Sep 22, 2020
1 parent 4934a89 commit e73fc0b
Show file tree
Hide file tree
Showing 6 changed files with 285 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ node_js:
- "12"
- "14"

script: yarn ci
script: yarn test

after_success:
- cat ./coverage/lcov.info | node_modules/.bin/coveralls --verbose
Expand Down
5 changes: 5 additions & 0 deletions husky.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
hooks: {
"pre-commit": "lint-staged",
},
};
4 changes: 4 additions & 0 deletions lint-staged.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
"*.js": ["eslint --fix", "prettier --write"],
"*.{json,md,yml,css,ts}": ["prettier --write"],
};
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,11 @@
"prettier": "prettier -l --ignore-path .gitignore .",
"eslint": "eslint --ignore-path .gitignore .",
"lint": "yarn eslint && yarn prettier",
"pretest": "yarn lint",
"test": "jest",
"test:only": "jest",
"test:watch": "jest --watch",
"test:coverage": "jest --coverage --collectCoverageFrom=\"src/**/*\"",
"test:ci": "yarn pretest && yarn cover",
"pretest": "yarn lint",
"test": "yarn test:coverage",
"prepublishOnly": "yarn test"
},
"dependencies": {
Expand All @@ -40,7 +39,9 @@
},
"devDependencies": {
"eslint": "^7.9.0",
"husky": "^4.3.0",
"jest": "^26.4.2",
"lint-staged": "^10.4.0",
"postcss": "^8.0.7",
"prettier": "^2.1.2"
},
Expand Down
9 changes: 0 additions & 9 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -508,15 +508,6 @@ module.exports = (options = {}) => {
return;
}

if (
rule.nodes &&
rule.selector.slice(0, 2) === "--" &&
rule.selector.slice(-1) === ":"
) {
// ignore custom property set
return;
}

const context = localizeNode(rule, options.mode, localAliasMap);

context.options = options;
Expand Down
Loading

0 comments on commit e73fc0b

Please sign in to comment.