Skip to content

Commit

Permalink
refactor: code (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
evilebottnawi authored Sep 21, 2020
1 parent fd4ffce commit 48e904f
Show file tree
Hide file tree
Showing 13 changed files with 2,598 additions and 1,998 deletions.
13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# editorconfig.org
root = true

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

[*.md]
trim_trailing_whitespace = false
18 changes: 9 additions & 9 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"parserOptions": {
"ecmaVersion": 2018
},
"env": {
"node": true
},
"rules": {
"quotes": [2, "single"]
}
"parserOptions": {
"ecmaVersion": 2018
},
"env": {
"es6": true,
"node": true,
"jest": true
},
"extends": "eslint:recommended"
}
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
node_modules
.idea
*.iml
.nyc_output
coverage
lib
node_modules
7 changes: 4 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
language: node_js

node_js:
- "6"
- "8"
- "10"
- "12"
script: npm run travis
- "14"

script: yarn ci

after_success:
- cat ./coverage/lcov.info | node_modules/.bin/coveralls --verbose
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,24 @@
# Change Log

All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## [2.2.0] - 2020-03-19

- added the `exportGlobals` option to export global classes and ids

## [2.1.1] - 2019-03-05

### Fixed

- add additional space after the escape sequence (#17)

## [2.1.0] - 2019-03-05

### Fixed

- handles properly selector with escaping characters (like: `.\31 a2b3c { color: red }`)

### Feature

- `generateExportEntry` option (allow to setup key and value for `:export {}` rule)
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ into:
so it doesn't pollute CSS global scope and can be simply used in JS like so:

```js
import styles from './buttons.css'
elem.innerHTML = `<button class="${styles.continueButton}">Continue</button>`
import styles from "./buttons.css";
elem.innerHTML = `<button class="${styles.continueButton}">Continue</button>`;
```

## Composition
Expand Down Expand Up @@ -79,8 +79,8 @@ npm test

[![Build Status](https://travis-ci.org/css-modules/postcss-modules-scope.svg?branch=master)](https://travis-ci.org/css-modules/postcss-modules-scope)

* Lines: [![Coverage Status](https://coveralls.io/repos/css-modules/postcss-modules-scope/badge.svg?branch=master)](https://coveralls.io/r/css-modules/postcss-modules-scope?branch=master)
* Statements: [![codecov.io](http://codecov.io/github/css-modules/postcss-modules-scope/coverage.svg?branch=master)](http://codecov.io/github/css-modules/postcss-modules-scope?branch=master)
- Lines: [![Coverage Status](https://coveralls.io/repos/css-modules/postcss-modules-scope/badge.svg?branch=master)](https://coveralls.io/r/css-modules/postcss-modules-scope?branch=master)
- Statements: [![codecov.io](http://codecov.io/github/css-modules/postcss-modules-scope/coverage.svg?branch=master)](http://codecov.io/github/css-modules/postcss-modules-scope?branch=master)

## Development

Expand All @@ -97,4 +97,5 @@ ISC
- Guy Bedford

---

Glen Maddern, 2015.
38 changes: 17 additions & 21 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,18 @@
"description": "A CSS Modules transform to extract export statements from local-scope classes",
"main": "src/index.js",
"engines": {
"node": ">= 6"
"node": ">= 10.13.0 || >= 12.13.0 || >= 14"
},
"scripts": {
"lint": "eslint src test",
"prettier": "prettier -l --ignore-path .gitignore . \"!test/test-cases\"",
"eslint": "eslint --ignore-path .gitignore .",
"lint": "yarn eslint && yarn prettier",
"pretest": "yarn lint",
"test": "mocha",
"autotest": "chokidar src test -c 'yarn test'",
"precover": "yarn lint",
"cover": "nyc mocha",
"travis": "yarn cover",
"prepublish": "yarn run test"
"test": "jest",
"autotest": "jest --watch",
"cover": "jest --coverage --collectCoverageFrom=\"src/**/*\"",
"ci": "yarn pretest && yarn cover",
"prepublishOnly": "yarn test"
},
"repository": {
"type": "git",
Expand All @@ -34,22 +35,17 @@
"url": "https://github.com/css-modules/postcss-modules-scope/issues"
},
"homepage": "https://github.com/css-modules/postcss-modules-scope",
"prettier": {
"semi": true,
"singleQuote": true,
"trailingComma": "es5"
},
"dependencies": {
"postcss": "^7.0.6",
"postcss-selector-parser": "^6.0.0"
"postcss-selector-parser": "^6.0.3"
},
"devDependencies": {
"cssesc": "^3.0.0",
"chokidar-cli": "^1.0.1",
"codecov.io": "^0.1.2",
"coveralls": "^3.0.2",
"eslint": "^5.9.0",
"mocha": "^6.0.2",
"nyc": "^14.1.0"
"eslint": "^7.9.0",
"jest": "^26.4.2",
"postcss": "^8.0.3",
"prettier": "^2.1.2"
},
"peerDependencies": {
"postcss": "^8.0.0"
}
}
Loading

0 comments on commit 48e904f

Please sign in to comment.