Skip to content

Commit e73fc0b

Browse files
refactor: code
1 parent 4934a89 commit e73fc0b

File tree

6 files changed

+285
-17
lines changed

6 files changed

+285
-17
lines changed

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ node_js:
55
- "12"
66
- "14"
77

8-
script: yarn ci
8+
script: yarn test
99

1010
after_success:
1111
- cat ./coverage/lcov.info | node_modules/.bin/coveralls --verbose

husky.config.js

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module.exports = {
2+
hooks: {
3+
"pre-commit": "lint-staged",
4+
},
5+
};

lint-staged.config.js

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module.exports = {
2+
"*.js": ["eslint --fix", "prettier --write"],
3+
"*.{json,md,yml,css,ts}": ["prettier --write"],
4+
};

package.json

+4-3
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,11 @@
2525
"prettier": "prettier -l --ignore-path .gitignore .",
2626
"eslint": "eslint --ignore-path .gitignore .",
2727
"lint": "yarn eslint && yarn prettier",
28-
"pretest": "yarn lint",
29-
"test": "jest",
3028
"test:only": "jest",
3129
"test:watch": "jest --watch",
3230
"test:coverage": "jest --coverage --collectCoverageFrom=\"src/**/*\"",
33-
"test:ci": "yarn pretest && yarn cover",
31+
"pretest": "yarn lint",
32+
"test": "yarn test:coverage",
3433
"prepublishOnly": "yarn test"
3534
},
3635
"dependencies": {
@@ -40,7 +39,9 @@
4039
},
4140
"devDependencies": {
4241
"eslint": "^7.9.0",
42+
"husky": "^4.3.0",
4343
"jest": "^26.4.2",
44+
"lint-staged": "^10.4.0",
4445
"postcss": "^8.0.7",
4546
"prettier": "^2.1.2"
4647
},

src/index.js

-9
Original file line numberDiff line numberDiff line change
@@ -508,15 +508,6 @@ module.exports = (options = {}) => {
508508
return;
509509
}
510510

511-
if (
512-
rule.nodes &&
513-
rule.selector.slice(0, 2) === "--" &&
514-
rule.selector.slice(-1) === ":"
515-
) {
516-
// ignore custom property set
517-
return;
518-
}
519-
520511
const context = localizeNode(rule, options.mode, localAliasMap);
521512

522513
context.options = options;

0 commit comments

Comments
 (0)