Skip to content

Commit e4d3c77

Browse files
authored
Merge pull request #6 from factorial-io/feature/apply-prettier-config
feature(prettier): optionally respect local prettier rules
2 parents d774fd1 + 63e5605 commit e4d3c77

File tree

6 files changed

+162
-82
lines changed

6 files changed

+162
-82
lines changed

README.md

+22-13
Original file line numberDiff line numberDiff line change
@@ -24,34 +24,43 @@ npm install --sav-dev `@factorial-io/drupal-breakpoints-css`
2424

2525
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:
2626

27-
```js
27+
```typescript
2828
// ./lib/types.d.ts
2929
export interface UserConfig {
3030
drupal: {
31-
path: string,
32-
themeName: string,
31+
breakpointsPath: string;
32+
themeName: string;
33+
};
34+
prettier?: {
35+
configPath: string;
3336
};
3437
js?: {
35-
enabled?: boolean,
36-
path?: string,
37-
es6?: "commonjs" | "module",
38+
enabled?: boolean;
39+
path?: string;
40+
type?: "commonjs" | "module";
3841
};
3942
css?: {
40-
enabled?: boolean,
41-
path?: string,
42-
element?: string,
43+
enabled?: boolean;
44+
path?: string;
45+
element?: string;
4346
};
4447
options?: {
45-
mediaQuery?: boolean,
46-
resolution?: boolean,
47-
minWidth?: boolean,
48-
maxWidth?: boolean,
48+
mediaQuery?: boolean;
49+
resolution?: boolean;
50+
minWidth?: boolean;
51+
maxWidth?: boolean;
4952
};
5053
}
5154
```
5255

56+
### Schema Validation
57+
5358
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).
5459

60+
### Prettier
61+
62+
To respect your local prettier formatting rules please add the path to the configuration file to `prettier.path`.
63+
5564
## Usage
5665

5766
Just run `yarn drupal-breakpoints-css start` or `npm run drupal-breakpoints-css start`. Thats it :)

lib/defaultConfig.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module.exports = {
22
drupal: {
3-
path: "",
3+
breakpointsPath: "",
44
themeName: "",
55
},
66
js: {

0 commit comments

Comments
 (0)