-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into chore/use-lit
- Loading branch information
Showing
10 changed files
with
108 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Prettier Configuration | ||
|
||
The Prettier configuration provides a consistent code style across the projects. | ||
|
||
## Configuration | ||
|
||
The configuration is defined in `src/core/prettier-config/index.ts`. | ||
|
||
## Usage | ||
|
||
To use the configuration, add it to your `.prettierrc.js` file in the root of your project: | ||
|
||
```javascript | ||
module.exports = require('@linuxfoundation/lfx-ui-core/prettier-config'); | ||
``` | ||
|
||
Add the `.prettierignore` file to the root of your project to ignore files from formatting. | ||
|
||
```bash | ||
**/*.* | ||
**/node_modules | ||
**/dist | ||
**/.angular/cache | ||
|
||
!src/**/*.html | ||
!src/**/*.ts | ||
!src/**/*.tsx | ||
!src/**/*.js | ||
!src/**/*.jsx | ||
!src/**/*.json | ||
!src/**/*.css | ||
!src/**/*.scss | ||
!src/**/*.md | ||
!src/**/*.mdx | ||
``` | ||
|
||
> **Note:** The `.prettierignore` file must be present in the top-level directory of your workspace for these ignore patterns to take effect. If you open a workspace subfolder directly and it doesn't contain its own `.prettierignore` file, these ignore settings will not be applied. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,37 @@ | ||
// Copyright The Linux Foundation and each contributor to LFX. | ||
// SPDX-License-Identifier: MIT | ||
|
||
import { Config } from 'prettier'; | ||
|
||
const prettierConfig: Config = { | ||
const prettierConfig = { | ||
// 160 is the default for the LF Design System | ||
printWidth: 160, | ||
// Use single quotes for strings | ||
singleQuote: true, | ||
// Use spaces instead of tabs | ||
useTabs: false, | ||
// Set tab width to 2 spaces | ||
tabWidth: 2, | ||
// Add semicolons at the end of statements | ||
semi: true, | ||
// Add spaces inside brackets | ||
bracketSpacing: true, | ||
// Add parentheses around arrow function parameters | ||
arrowParens: 'always', | ||
trailingComma: 'none', | ||
bracketSameLine: true | ||
// Use ES5 trailing commas | ||
trailingComma: 'es5', | ||
// Put the closing bracket on the same line as the last element | ||
bracketSameLine: true, | ||
// Use LF line endings | ||
endOfLine: 'lf', | ||
// Override settings for specific file types | ||
overrides: [ | ||
{ | ||
files: ['*.json'], | ||
options: { | ||
trailingComma: 'none', | ||
}, | ||
}, | ||
], | ||
}; | ||
|
||
module.exports = prettierConfig; | ||
export type PrettierConfig = typeof prettierConfig; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters