Skip to content

Commit

Permalink
Merge pull request #4 from foobaragency/improve-docs-structure
Browse files Browse the repository at this point in the history
chore: improve docs, change folder structure, improve npm package
  • Loading branch information
kaiserbock authored Mar 4, 2022
2 parents 3da238c + 50326b2 commit dff42f8
Show file tree
Hide file tree
Showing 10 changed files with 19 additions and 6 deletions.
4 changes: 4 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
module.exports = {
parserOptions: {
ecmaVersion: 2020,
sourceType: "module",
ecmaFeatures: {
jsx: true,
},
},
env: {
node: true,
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

[PostCSS](https://github.com/postcss/postcss) syntax for parsing [styled jsx](https://github.com/vercel/styled-jsx)

### Disclaimers

1. This package is intended to be used as a custom syntax for stylelint on React or Next.js projects using styled jsx. We have no intention of supporting all postcss post-processing features.
2. We're not using the `postcss-css-in-js` from stylelint because that package is meant to be deprecated. See [this issue](https://github.com/stylelint/postcss-css-in-js/issues/225)

## Getting started

```bash
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 0 additions & 2 deletions template-tokenize.js → lib/template-tokenize.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ function templateTokenize(input) {
break
}
} while ((next = tokenizer.nextToken()))
} else {
tokenizer.back(next)
}
}
return token
Expand Down
10 changes: 8 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
{
"name": "@foobar-agency/postcss-styled-jsx",
"name": "postcss-styled-jsx",
"version": "0.0.0-semantically-released",
"description": "PostCSS syntax for parsing styled-jsx",
"main": "./lib/index.js",
"files": [
"lib"
],
"keywords": [
"postcss",
"syntax",
Expand All @@ -20,13 +24,15 @@
"type": "git",
"url": "https://github.com/foobaragency/postcss-styled-jsx"
},
"author": "foobar Agency GmbH",
"license": "MIT",
"scripts": {
"fix": "yarn lint:prettier --write && yarn lint --fix",
"lint": "eslint --ext .js --cache .",
"lint:prettier": "prettier \"**/*.{js,ts,json,md,yml}\" --ignore-path .gitignore",
"semantic-release": "semantic-release",
"test": "vitest"
"test": "vitest",
"test:cov": "vitest --coverage"
},
"devDependencies": {
"@semantic-release/changelog": "^6.0.1",
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions index.test.jsx → test/index.test.jsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { readFileSync } from "fs"
import { describe, expect, it } from "vitest"
import syntax from "."
import syntax from "../lib"

describe("syntax", () => {
const jsx = readFileSync("./components.jsx", "utf8")
const jsx = readFileSync("./test/fixtures/components.jsx", "utf8")

it("Component", () => {
const document = syntax().parse(jsx)
Expand Down

0 comments on commit dff42f8

Please sign in to comment.