Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature(prettier): optionally respect local prettier rules #6

Merged
merged 10 commits into from
Sep 19, 2022
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