@modern-js-app/eslint-config 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,74 @@
1
+ module.exports = {
2
+ // https://eslint.org/docs/user-guide/configuring#extending-configuration-files
3
+ extends: [
4
+ './eslintrc.js',
5
+ // https://www.npmjs.com/package/eslint-config-prettier
6
+ // https://github.com/prettier/eslint-config-prettier/blob/master/index.js#L14
7
+ 'prettier',
8
+ ],
9
+ env: {
10
+ commonjs: false,
11
+ browser: true,
12
+ node: false,
13
+ },
14
+ rules: {
15
+ // https://github.com/prettier/eslint-config-prettier#curly
16
+ curly: 'error',
17
+ // https://github.com/prettier/eslint-config-prettier#max-len
18
+ 'max-len': [
19
+ 'error',
20
+ {
21
+ code: 80,
22
+ tabWidth: 4,
23
+ ignoreComments: true,
24
+ ignoreTrailingComments: false,
25
+ ignoreUrls: true,
26
+ ignoreStrings: true,
27
+ ignoreTemplateLiterals: true,
28
+ ignoreRegExpLiterals: true,
29
+ },
30
+ ],
31
+ // https://github.com/prettier/eslint-config-prettier#no-confusing-arrow
32
+ 'no-confusing-arrow': 'off',
33
+ // https://github.com/prettier/eslint-config-prettier#no-mixed-operators
34
+ 'no-mixed-operators': 'off',
35
+ // https://github.com/prettier/eslint-config-prettier#no-tabs
36
+ 'no-tabs': 'error',
37
+ // https://github.com/prettier/eslint-config-prettier#quotes
38
+ quotes: 'off',
39
+ },
40
+ // https://eslint.org/docs/user-guide/configuring#configuration-based-on-glob-patterns
41
+ // https://eslint.org/docs/user-guide/migrating-to-6.0.0#-overrides-in-an-extended-config-file-can-now-be-overridden-by-a-parent-config-file
42
+ overrides: [
43
+ {
44
+ files: ['*.ts', '*.tsx'],
45
+ rules: {
46
+ '@typescript-eslint/indent': 'off',
47
+ '@typescript-eslint/member-delimiter-style': 'off',
48
+ '@typescript-eslint/type-annotation-spacing': 'off',
49
+ },
50
+ },
51
+ {
52
+ files: ['*.test.*', '__test__/*'],
53
+ env: {
54
+ mocha: true,
55
+ jest: true,
56
+ },
57
+ rules: {
58
+ 'no-unused-expressions': 'off',
59
+ '@babel/no-unused-expressions': 'off',
60
+ },
61
+ },
62
+ {
63
+ files: ['*.worker.*'],
64
+ env: { worker: true },
65
+ },
66
+ {
67
+ files: ['**/pages/**/_*', '**/pages/**/\\[**'],
68
+ rules: {
69
+ 'filenames/match-regex': 'off',
70
+ 'filenames/match-exported': 'off',
71
+ },
72
+ },
73
+ ],
74
+ };
package/index.js ADDED
@@ -0,0 +1 @@
1
+ module.exports = { extends: ['./eslintrc.prettier.js'] };
package/package.json ADDED
@@ -0,0 +1,38 @@
1
+ {
2
+ "name": "@modern-js-app/eslint-config",
3
+ "version": "0.1.1",
4
+ "description": "",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "check": "eslint-find-rules --unused index.js",
8
+ "stat": "eslint-index index.js --format table"
9
+ },
10
+ "peerDependencies": {
11
+ "@babel/eslint-parser": "^7.15.0",
12
+ "@babel/eslint-plugin": "^7.13.10",
13
+ "@typescript-eslint/eslint-plugin": "^4",
14
+ "@typescript-eslint/parser": "^4",
15
+ "eslint": "^7.32.0",
16
+ "eslint-config-prettier": "^8.3.0",
17
+ "eslint-import-resolver-webpack": "^0.13.1",
18
+ "eslint-plugin-eslint-comments": "^3.1.1",
19
+ "eslint-plugin-filenames": "^1.3.2",
20
+ "eslint-plugin-import": "^2.18.2",
21
+ "eslint-plugin-markdown": "^2.2.0",
22
+ "eslint-plugin-node": "^11.1.0",
23
+ "eslint-plugin-prettier": "^3.4.1",
24
+ "eslint-plugin-promise": "^5.1.0",
25
+ "eslint-plugin-react": "^7.24.0",
26
+ "eslint-plugin-react-hooks": "^4.2.0",
27
+ "prettier": "^2.0.1"
28
+ },
29
+ "dependencies": {
30
+ "@modern-js/babel-preset-app": "workspace:^1.0.0-rc.2"
31
+ },
32
+ "devDependencies": {
33
+ "eslint": "^7.32.0",
34
+ "eslint-find-rules": "^3.4.0",
35
+ "eslint-index": "^1.5.0"
36
+ },
37
+ "keywords": []
38
+ }
package/utils.js ADDED
@@ -0,0 +1,11 @@
1
+ exports.jsExtensions = [
2
+ '.js',
3
+ '.jsx',
4
+ '.ts',
5
+ '.d.ts',
6
+ '.tsx',
7
+ '.mjs',
8
+ '.mjsx',
9
+ '.cjs',
10
+ '.cjsx',
11
+ ];