Skip to content

Commit

Permalink
fix: fixed eslint file content
Browse files Browse the repository at this point in the history
  • Loading branch information
AnthonyLzq committed Dec 26, 2021
1 parent f506415 commit 85d4eb0
Show file tree
Hide file tree
Showing 3 changed files with 111 additions and 102 deletions.
98 changes: 49 additions & 49 deletions example/.eslintrc
Original file line number Diff line number Diff line change
@@ -1,67 +1,67 @@
module.exports = {
env: {
node: true
{
"env": {
"node": true
},
root: true,
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint', 'import', 'prettier'],
extends: [
'standard',
'eslint:recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'prettier'
"root": true,
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint", "import", "prettier"],
"extends": [
"standard",
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"prettier"
],
rules: {
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/no-empty-interface': 'off',
'arrow-parens': ['error', 'as-needed'],
'import/extensions': [
"rules": {
"@typescript-eslint/no-var-requires": "off",
"@typescript-eslint/no-empty-interface": "off",
"arrow-parens": ["error", "as-needed"],
"import/extensions": [
2,
{
ts: 'never',
js: 'always',
json: 'always'
"ts": "never",
"js": "always",
"json": "always"
}
],
'import/no-extraneous-dependencies': [
'error',
"import/no-extraneous-dependencies": [
"error",
{
devDependencies: ['**/*.test.js', 'webpack.config.js'],
optionalDependencies: ['**/*.test.js'],
peerDependencies: ['**/*.test.js']
"devDependencies": ["**/*.test.js", "webpack.config.js"],
"optionalDependencies": ["**/*.test.js"],
"peerDependencies": ["**/*.test.js"]
}
],
'max-len': [
'error',
"max-len": [
"error",
{
code: 80,
ignoreComments: true,
ignoreRegExpLiterals: true,
ignoreTemplateLiterals: true,
ignoreTrailingComments: true,
ignoreStrings: true,
ignoreUrls: true
"code": 80,
"ignoreComments": true,
"ignoreRegExpLiterals": true,
"ignoreTemplateLiterals": true,
"ignoreTrailingComments": true,
"ignoreStrings": true,
"ignoreUrls": true
}
],
'newline-before-return': 'error',
'object-curly-spacing': ['error', 'always'],
"newline-before-return": "error",
"object-curly-spacing": ["error", "always"],
"object-shorthand": ["error", "always"],
'prefer-const': 'error',
'prettier/prettier': [
'error',
"prefer-const": "error",
"prettier/prettier": [
"error",
{
arrowParens: 'avoid',
bracketSpacing: true,
printWidth: 80,
quoteProps: 'as-needed',
semi: false,
singleQuote: true,
tabWidth: 2,
trailingComma: 'none'
"arrowParens": "avoid",
"bracketSpacing": true,
"printWidth": 80,
"quoteProps": "as-needed",
"semi": false,
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "none"
}
],
radix: ['error', 'as-needed'],
'spaced-comment': ['error', 'always']
"radix": ["error", "as-needed"],
"spaced-comment": ["error", "always"]
}
}
17 changes: 13 additions & 4 deletions example/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -998,7 +998,7 @@ conventional-changelog-config-spec@2.1.0:
resolved "https://registry.yarnpkg.com/conventional-changelog-config-spec/-/conventional-changelog-config-spec-2.1.0.tgz#874a635287ef8b581fd8558532bf655d4fb59f2d"
integrity sha512-IpVePh16EbbB02V+UA+HQnnPIohgXvJRxHcS5+Uwk4AT5LjzCZJm5sp/yqs5C6KZJ1jMsV4paEV13BN1pvDuxQ==

conventional-changelog-conventionalcommits@4.6.1, conventional-changelog-conventionalcommits@^4.5.0:
conventional-changelog-conventionalcommits@4.6.1:
version "4.6.1"
resolved "https://registry.yarnpkg.com/conventional-changelog-conventionalcommits/-/conventional-changelog-conventionalcommits-4.6.1.tgz#f4c0921937050674e578dc7875f908351ccf4014"
integrity sha512-lzWJpPZhbM1R0PIzkwzGBCnAkH5RKJzJfFQZcl/D+2lsJxAwGnDKBqn/F4C1RD31GJNn8NuKWQzAZDAVXPp2Mw==
Expand All @@ -1007,6 +1007,15 @@ conventional-changelog-conventionalcommits@4.6.1, conventional-changelog-convent
lodash "^4.17.15"
q "^1.5.1"

conventional-changelog-conventionalcommits@^4.5.0:
version "4.6.2"
resolved "https://registry.yarnpkg.com/conventional-changelog-conventionalcommits/-/conventional-changelog-conventionalcommits-4.6.2.tgz#6debf07a894f7c7e22b950e2f872de334d5d49ed"
integrity sha512-fo+VhM0VtD3wdHZtrPhgvTFjAhAMUjYeQV6B5+DB/cupG1O554pJdTwrvBInq8JLHl+GucKQpZycMPye/OpgSw==
dependencies:
compare-func "^2.0.0"
lodash "^4.17.15"
q "^1.5.1"

conventional-changelog-core@^4.2.1:
version "4.2.4"
resolved "https://registry.yarnpkg.com/conventional-changelog-core/-/conventional-changelog-core-4.2.4.tgz#e50d047e8ebacf63fac3dc67bf918177001e1e9f"
Expand Down Expand Up @@ -1328,9 +1337,9 @@ ee-first@1.1.1:
integrity sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=

electron-to-chromium@^1.4.17:
version "1.4.27"
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.27.tgz#bfc6e798d8a56a17d658312f4b7ae1a7ca87724f"
integrity sha512-uZ95szi3zUbzRDx1zx/xnsCG+2xgZyy57pDOeaeO4r8zx5Dqe8Jv1ti8cunvBwJHVI5LzPuw8umKwZb3WKYxSQ==
version "1.4.28"
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.28.tgz#fef0e92e281df6d568f482d8d53c34ca5374de48"
integrity sha512-Gzbf0wUtKfyPaqf0Plz+Ctinf9eQIzxEqBHwSvbGfeOm9GMNdLxyu1dNiCUfM+x6r4BE0xUJNh3Nmg9gfAtTmg==

emoji-regex@^8.0.0:
version "8.0.0"
Expand Down
98 changes: 49 additions & 49 deletions lib/src/functions/eslint.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,71 +6,71 @@ const writeFile = require('../utils/writeFile')
*/
module.exports = async projectName => {
const data = {
eslintContent: `module.exports = {
env: {
node: true
eslintContent: `{
"env": {
"node": true
},
root: true,
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint', 'import', 'prettier'],
extends: [
'standard',
'eslint:recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'prettier'
"root": true,
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint", "import", "prettier"],
"extends": [
"standard",
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"prettier"
],
rules: {
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/no-empty-interface': 'off',
'arrow-parens': ['error', 'as-needed'],
'import/extensions': [
"rules": {
"@typescript-eslint/no-var-requires": "off",
"@typescript-eslint/no-empty-interface": "off",
"arrow-parens": ["error", "as-needed"],
"import/extensions": [
2,
{
ts: 'never',
js: 'always',
json: 'always'
"ts": "never",
"js": "always",
"json": "always"
}
],
'import/no-extraneous-dependencies': [
'error',
"import/no-extraneous-dependencies": [
"error",
{
devDependencies: ['**/*.test.js', 'webpack.config.js'],
optionalDependencies: ['**/*.test.js'],
peerDependencies: ['**/*.test.js']
"devDependencies": ["**/*.test.js", "webpack.config.js"],
"optionalDependencies": ["**/*.test.js"],
"peerDependencies": ["**/*.test.js"]
}
],
'max-len': [
'error',
"max-len": [
"error",
{
code: 80,
ignoreComments: true,
ignoreRegExpLiterals: true,
ignoreTemplateLiterals: true,
ignoreTrailingComments: true,
ignoreStrings: true,
ignoreUrls: true
"code": 80,
"ignoreComments": true,
"ignoreRegExpLiterals": true,
"ignoreTemplateLiterals": true,
"ignoreTrailingComments": true,
"ignoreStrings": true,
"ignoreUrls": true
}
],
'newline-before-return': 'error',
'object-curly-spacing': ['error', 'always'],
"newline-before-return": "error",
"object-curly-spacing": ["error", "always"],
"object-shorthand": ["error", "always"],
'prefer-const': 'error',
'prettier/prettier': [
'error',
"prefer-const": "error",
"prettier/prettier": [
"error",
{
arrowParens: 'avoid',
bracketSpacing: true,
printWidth: 80,
quoteProps: 'as-needed',
semi: false,
singleQuote: true,
tabWidth: 2,
trailingComma: 'none'
"arrowParens": "avoid",
"bracketSpacing": true,
"printWidth": 80,
"quoteProps": "as-needed",
"semi": false,
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "none"
}
],
radix: ['error', 'as-needed'],
'spaced-comment': ['error', 'always']
"radix": ["error", "as-needed"],
"spaced-comment": ["error", "always"]
}
}
`,
Expand Down

0 comments on commit 85d4eb0

Please sign in to comment.