Skip to content

Commit c878ec1

Browse files
authoredFeb 24, 2024
feat(prettier): config updates (#305)
* feat(prettier): update print width to 100 and set vueIndentScriptAndStyle to true * chore: point prettier config to workspace file * fix: use typescript eslint config in root * chore(prettier-config): set version to 0.0.1 * docs(changeset): update printWidth, trailingComma, and vueIndentScriptAndStyle * docs(changeset): change prettier-config release to major * chore: format with updated prettier config * fix: use typescript eslint config for linting all packages

17 files changed

+58
-57
lines changed
 

‎.changeset/short-boats-taste.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@cpsoinos/prettier-config': major
3+
---
4+
5+
update printWidth, trailingComma, and vueIndentScriptAndStyle

‎.eslintrc

-3
This file was deleted.

‎.eslintrc.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": "./packages/typescript/index.js"
3+
}

‎.prettierrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
"@cpsoinos/prettier-config"
1+
"./packages/prettier/index.js"

‎README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ pnpm add @cpsoinos/eslint-config-typescript -D
2727
```js
2828
module.exports = {
2929
extends: [
30-
'@cpsoinos/eslint-config-typescript' // or '@cpsoinos/eslint-config-react-ts'
31-
]
30+
'@cpsoinos/eslint-config-typescript', // or '@cpsoinos/eslint-config-react-ts'
31+
],
3232
}
3333
```
3434

‎package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "@cpsoinos/eslint-config",
2+
"name": "@cpsoinos/config",
33
"scripts": {
44
"ci:format": "prettier --write --check --no-error-on-unmatched-pattern \"**/*.{js,jsx,ts,tsx,vue,md,mdx,gql,graphql,json,yml,yaml}\"",
55
"ci:publish": "changeset publish",
@@ -26,7 +26,7 @@
2626
"@changesets/cli": "2.27.1",
2727
"@commitlint/cli": "18.6.1",
2828
"@commitlint/config-conventional": "18.6.2",
29-
"@cpsoinos/eslint-config-base": "workspace:*",
29+
"@cpsoinos/eslint-config-typescript": "workspace:*",
3030
"@cpsoinos/prettier-config": "workspace:*",
3131
"@nrwl/nx-cloud": "latest",
3232
"@nrwl/workspace": "18.0.5",

‎packages/base/index.js

+9-9
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,20 @@ module.exports = {
44
ecmaVersion: 2020, // Allows for the parsing of modern ECMAScript features
55
sourceType: 'module', // Allows for the use of imports
66
ecmaFeatures: {
7-
jsx: true // Allows for the parsing of JSX
8-
}
7+
jsx: true, // Allows for the parsing of JSX
8+
},
99
},
1010
extends: [
1111
'standard', // https://standardjs.com style guide
1212
'eslint:recommended',
1313
'plugin:import/recommended',
1414
'plugin:yml/standard',
15-
'plugin:markdown/recommended'
15+
'plugin:markdown/recommended',
1616
],
1717
env: {
1818
node: true,
1919
browser: true,
20-
es6: true
20+
es6: true,
2121
},
2222
ignorePatterns: [
2323
'*.min.*',
@@ -34,7 +34,7 @@ module.exports = {
3434
'__snapshots__',
3535
'!.github',
3636
'!.vitepress',
37-
'!.vscode'
37+
'!.vscode',
3838
],
3939
rules: {
4040
// change to standardjs.com rules: prefer *no* space btw named function and argument parens
@@ -43,8 +43,8 @@ module.exports = {
4343
{
4444
anonymous: 'always',
4545
named: 'never',
46-
asyncArrow: 'always'
47-
}
46+
asyncArrow: 'always',
47+
},
4848
],
4949
'no-console': 'off',
5050
'no-process-env': 0,
@@ -54,7 +54,7 @@ module.exports = {
5454
// import
5555
'import/order': 'error',
5656
'import/first': 'error',
57-
'import/no-unresolved': 'off'
57+
'import/no-unresolved': 'off',
5858
},
59-
plugins: ['import']
59+
plugins: ['import'],
6060
}

‎packages/base/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"index.js"
1515
],
1616
"scripts": {
17-
"lint": "eslint . --config=index.js"
17+
"lint": "eslint ."
1818
},
1919
"dependencies": {
2020
"eslint-config-standard": "^17.1.0",

‎packages/prettier/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ module.exports = {
22
arrowParens: 'always',
33
semi: false,
44
singleQuote: true,
5-
trailingComma: 'none',
6-
printWidth: 100
5+
printWidth: 100,
6+
vueIndentScriptAndStyle: true,
77
}

‎packages/prettier/package.json

+5-9
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,20 @@
11
{
22
"name": "@cpsoinos/prettier-config",
3-
"version": "0.0.0",
3+
"version": "0.0.1",
44
"description": "Prettier config",
5-
"homepage": "https://github.com/PrimaryKids/eslint-config#readme",
5+
"homepage": "https://github.com/cpsoinos/config#readme",
66
"bugs": {
7-
"url": "https://github.com/PrimaryKids/eslint-config/issues"
7+
"url": "https://github.com/cpsoinos/config/issues"
88
},
99
"repository": {
1010
"type": "git",
1111
"url": "git+https://github.com/cpsoinos/config.git"
1212
},
13-
"license": "ISC",
13+
"license": "MIT",
1414
"author": "Corey Psoinos <coreypsoinos@gmail.com>",
1515
"main": "index.js",
16-
"directories": {
17-
"lib": "lib",
18-
"test": "__tests__"
19-
},
2016
"files": [
21-
"lib"
17+
"index.js"
2218
],
2319
"scripts": {
2420
"test": "echo \"Error: run tests from root\" && exit 1"

‎packages/react-ts/index.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ module.exports = {
33
'@cpsoinos/eslint-config-typescript',
44
'plugin:react/recommended', // react-specific rules
55
'plugin:react-hooks/recommended',
6-
'prettier' // must be last
6+
'prettier', // must be last
77
],
88
env: {
9-
browser: 1
9+
browser: 1,
1010
},
1111
settings: {
1212
react: {
13-
version: 'detect'
14-
}
15-
}
13+
version: 'detect',
14+
},
15+
},
1616
}

‎packages/react-ts/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"index.js"
1515
],
1616
"scripts": {
17-
"lint": "eslint . --config=index.js"
17+
"lint": "eslint ."
1818
},
1919
"dependencies": {
2020
"@cpsoinos/eslint-config-typescript": "workspace:*",

‎packages/typescript/index.js

+8-8
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,28 @@ module.exports = {
22
parser: '@typescript-eslint/parser', // Specifies the ESLint parser
33
parserOptions: {
44
ecmaVersion: 'latest', // Allows for the parsing of modern ECMAScript features
5-
sourceType: 'module' // Allows for the use of imports
5+
sourceType: 'module', // Allows for the use of imports
66
},
77
extends: [
88
'@cpsoinos/eslint-config-base',
99
'plugin:@typescript-eslint/recommended', // Uses the recommended rules from the @typescript-eslint/eslint-plugin
1010
'plugin:typescript-sort-keys/recommended', // Sort keys in interfaces and enums
11-
'prettier' // must be last
11+
'prettier', // must be last
1212
],
1313
rules: {
1414
'@typescript-eslint/explicit-function-return-type': 'off',
1515
'@typescript-eslint/explicit-module-boundary-types': 'off',
1616
'no-use-before-define': 'off',
17-
'@typescript-eslint/no-use-before-define': ['error']
17+
'@typescript-eslint/no-use-before-define': ['error'],
1818
},
1919
settings: {
2020
'import/parsers': {
21-
'@typescript-eslint/parser': ['.ts', '.tsx']
21+
'@typescript-eslint/parser': ['.ts', '.tsx'],
2222
},
2323
'import/resolver': {
2424
typescript: {
25-
alwaysTryTypes: true // always try to resolve types under `<root>@types` directory even it doesn't contain any source code, like `@types/unist`
26-
}
27-
}
28-
}
25+
alwaysTryTypes: true, // always try to resolve types under `<root>@types` directory even it doesn't contain any source code, like `@types/unist`
26+
},
27+
},
28+
},
2929
}

‎packages/typescript/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"index.js"
1515
],
1616
"scripts": {
17-
"lint": "eslint . --config=index.js"
17+
"lint": "eslint ."
1818
},
1919
"dependencies": {
2020
"@cpsoinos/eslint-config-base": "workspace:*",

‎packages/vue-ts/index.js

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,33 @@
11
module.exports = {
22
parserOptions: {
33
ecmaVersion: 'latest',
4-
sourceType: 'module'
4+
sourceType: 'module',
55
},
66
overrides: [
77
{
88
files: ['*.vue'],
99
parser: 'vue-eslint-parser',
1010
parserOptions: {
11-
parser: '@typescript-eslint/parser'
12-
}
13-
}
11+
parser: '@typescript-eslint/parser',
12+
},
13+
},
1414
],
1515
extends: [
1616
'@cpsoinos/eslint-config-typescript',
1717
'plugin:vue/vue3-recommended',
18-
'prettier' // must be last
18+
'prettier', // must be last
1919
],
2020
env: {
21-
'vue/setup-compiler-macros': true
21+
'vue/setup-compiler-macros': true,
2222
},
2323
rules: {
2424
'vue/no-v-html': 'off',
2525
'vue/multi-word-component-names': 'off',
2626
'vue/component-tags-order': [
2727
'error',
2828
{
29-
order: ['script', 'template', 'style']
30-
}
31-
]
32-
}
29+
order: ['script', 'template', 'style'],
30+
},
31+
],
32+
},
3333
}

‎packages/vue-ts/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"index.js"
1414
],
1515
"scripts": {
16-
"lint": "eslint . --config=index.js"
16+
"lint": "eslint ."
1717
},
1818
"dependencies": {
1919
"@cpsoinos/eslint-config-typescript": "workspace:*",

‎pnpm-lock.yaml

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)
Please sign in to comment.