Skip to content

Commit 354c54f

Browse files
committed
refactor: migrate towards vue/es6 base
1 parent b401b3e commit 354c54f

File tree

14 files changed

+105
-168
lines changed

14 files changed

+105
-168
lines changed

README.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ Where projects start with configs to keep or replace with team specified ones. O
66
* [Iceman](https://github.com/sourcetoad/pod-iceman-linter-config)
77

88
### Current configs
9-
* [Common](packages/common/README.md)
10-
* [ES6](packages/es6/README.md)
11-
* [React Native](packages/react-native/README.md)
9+
* [Common](packages/es6/README.md)
10+
* [ES6](packages/vue/README.md)
11+
12+
13+
## Notes
14+
15+
* In order for this package to work properly. We peer to all dependencies.
16+
* This means the consuming package must include the peered dependencies.
17+
* This prevents a mismatch of versions if the rules limited what version of eslint could be used.

package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,9 @@
1919
"packages/*"
2020
],
2121
"scripts": {
22-
"lint": "npm run lint:common && npm run lint:es6 && npm run lint:react-native",
23-
"lint:common": "npm -w packages/common run lint",
22+
"lint": "npm run lint:es6 && npm run lint:vue",
2423
"lint:es6": "npm -w packages/es6 run lint",
25-
"lint:react-native": "npm -w packages/react-native run lint"
24+
"lint:vue": "npm -w packages/vue run lint"
2625
},
2726
"devDependencies": {
2827
"eslint": "^8.0"

packages/common/README.md

Lines changed: 0 additions & 3 deletions
This file was deleted.

packages/common/index.cjs

Lines changed: 0 additions & 45 deletions
This file was deleted.

packages/common/package.json

Lines changed: 0 additions & 24 deletions
This file was deleted.

packages/es6/README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# ES6 Javascript config
2-
3-
An example where ES6 based configurations would be placed.
1+
# Common Config
42

3+
An example where common configurations would be placed. These would be common between mobile and desktop.

packages/es6/index.cjs

Lines changed: 40 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,46 @@
11
module.exports = {
2-
extends: [
2+
'env': {
3+
'browser': true,
4+
'es2021': true,
5+
},
6+
'extends': [
37
'eslint:recommended',
4-
'@sourcetoad/eslint-base-template-configs-common',
8+
'plugin:@typescript-eslint/recommended',
59
],
6-
env: {
7-
es6: true,
8-
},
9-
parserOptions: {
10-
sourceType: 'module',
11-
ecmaVersion: 'latest',
10+
'ignorePatterns': ['/.eslintrc.js', '/*.config.js'],
11+
'overrides': [],
12+
'parser': 'vue-eslint-parser',
13+
'parserOptions': {
14+
'ecmaVersion': 'latest',
15+
'sourceType': 'module',
16+
'parser': '@typescript-eslint/parser',
1217
},
13-
plugins: [
14-
'unused-imports',
18+
'plugins': [
19+
'@typescript-eslint',
20+
'simple-import-sort'
1521
],
16-
/* eslint sort-keys: ["error", "asc"] */
17-
rules: {
18-
'no-unused-vars': ['error', {'args': 'none'}],
19-
'no-var': 'error',
20-
'require-jsdoc': 'off',
21-
'unused-imports/no-unused-imports': 'error',
22-
'valid-jsdoc': 'error',
23-
},
24-
/* eslint sort-keys: "off" */
22+
'rules': {
23+
'array-bracket-spacing': ['error', 'never'],
24+
'comma-dangle': ['error', 'always-multiline'],
25+
'eqeqeq': 'error',
26+
'indent': ['error', 4, {'SwitchCase': 1}],
27+
'max-len': ['error', 120, {'ignorePattern': '^import'}],
28+
'no-console': ['error', {'allow': ['warn', 'error']}],
29+
'object-curly-spacing': ['error', 'never'],
30+
'prefer-const': 'warn',
31+
'quotes': [
32+
'error',
33+
'single',
34+
{
35+
'avoidEscape': true,
36+
},
37+
],
38+
'semi': ['error'],
39+
'simple-import-sort/imports': [
40+
'error',
41+
{
42+
'groups': [['^\\u0000', '^node:', '^@?\\w', '^', '^\\.']],
43+
}
44+
],
45+
}
2546
};

packages/es6/package.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,8 @@
1818
"scripts": {
1919
"lint": "eslint . --ext=.js,.cjs,.mjs,.ts"
2020
},
21-
"dependencies": {
22-
"@sourcetoad/eslint-base-template-configs-common": "^0.0.1"
23-
},
2421
"peerDependencies": {
2522
"eslint": ">=8.0",
26-
"eslint-plugin-unused-imports": ">=2.0.0"
23+
"eslint-plugin-simple-import-sort": ">=10.0.0"
2724
}
2825
}

packages/react-native/README.md

Lines changed: 0 additions & 3 deletions
This file was deleted.

packages/react-native/index.cjs

Lines changed: 0 additions & 39 deletions
This file was deleted.

0 commit comments

Comments
 (0)