Skip to content

Commit

Permalink
Merge pull request #6 from factorial-io/feature/apply-prettier-config
Browse files Browse the repository at this point in the history
feature(prettier): optionally respect local prettier rules
  • Loading branch information
dnnsjrng authored Sep 19, 2022
2 parents d774fd1 + 63e5605 commit e4d3c77
Show file tree
Hide file tree
Showing 6 changed files with 162 additions and 82 deletions.
35 changes: 22 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,34 +24,43 @@ npm install --sav-dev `@factorial-io/drupal-breakpoints-css`

In your themes root folder, besides your already defined breakpoints file from Drupal, add a `breakpoints.config.yml` configuration file. The following properties are mandatory:

```js
```typescript
// ./lib/types.d.ts
export interface UserConfig {
drupal: {
path: string,
themeName: string,
breakpointsPath: string;
themeName: string;
};
prettier?: {
configPath: string;
};
js?: {
enabled?: boolean,
path?: string,
es6?: "commonjs" | "module",
enabled?: boolean;
path?: string;
type?: "commonjs" | "module";
};
css?: {
enabled?: boolean,
path?: string,
element?: string,
enabled?: boolean;
path?: string;
element?: string;
};
options?: {
mediaQuery?: boolean,
resolution?: boolean,
minWidth?: boolean,
maxWidth?: boolean,
mediaQuery?: boolean;
resolution?: boolean;
minWidth?: boolean;
maxWidth?: boolean;
};
}
```

### Schema Validation

You could validate your configuration files with the help of [JSON Schema Store](https://www.schemastore.org/json) and e.g [Visual Studio Code](https://code.visualstudio.com/) [YAML Extension](https://marketplace.visualstudio.com/items?itemName=redhat.vscode-yaml).

### Prettier

To respect your local prettier formatting rules please add the path to the configuration file to `prettier.path`.

## Usage

Just run `yarn drupal-breakpoints-css start` or `npm run drupal-breakpoints-css start`. Thats it :)
Expand Down
2 changes: 1 addition & 1 deletion lib/defaultConfig.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = {
drupal: {
path: "",
breakpointsPath: "",
themeName: "",
},
js: {
Expand Down
Loading

0 comments on commit e4d3c77

Please sign in to comment.