Skip to content

Commit

Permalink
Added plugins to format html and json
Browse files Browse the repository at this point in the history
  • Loading branch information
maksim-romanov committed Aug 25, 2023
1 parent 3cbc727 commit 874218a
Show file tree
Hide file tree
Showing 4 changed files with 317 additions and 32 deletions.
19 changes: 9 additions & 10 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
{
"editor.codeActionsOnSave": { "source.fixAll.eslint": true },
"editor.formatOnSave": true,

// "prettier.requireConfig": true,

// "editor.defaultFormatter": "dbaeumer.vscode-eslint",
"[javascript]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
},

"editor.tabSize": 2,
"editor.insertSpaces": true,
"editor.detectIndentation": false,

"editor.codeActionsOnSave": { "source.fixAll.eslint": true },
"editor.formatOnSave": true,
"editor.defaultFormatter": "dbaeumer.vscode-eslint",
"eslint.validate": [
"javascript",
"html",
"json"
],

"files.exclude": {
"**/node_modules/*": true,
"**/.git": true,
Expand Down
36 changes: 26 additions & 10 deletions eslint-config-base/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module.exports = {
env: {
browser: true,
es2021: true
es2021: true,
},
extends: [
'standard',
Expand All @@ -11,32 +11,48 @@ module.exports = {
],
plugins: [
'import',
'@html-eslint',
'json-format',
'@cspell'
],
overrides: [
{
env: {
node: true
node: true,
},
files: [
'.eslintrc.{js,cjs}'
],
parserOptions: {
sourceType: 'script'
}
sourceType: 'script',
},
},
{
files: ['*.html'],
parser: '@html-eslint/parser',
extends: ['plugin:@html-eslint/recommended'],
}
],
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module'
sourceType: 'module',
},
rules: {
indent: ['error', 2],
'prettier/prettier': 'off',

'comma-dangle': ['error', {
objects: 'always',
arrays: 'never',
imports: 'never',
exports: 'never',
functions: 'never',
}],

'@cspell/spellchecker': [
'warn',
{
checkComments: false
checkComments: false,
}
],

Expand All @@ -52,9 +68,9 @@ module.exports = {
],
alphabetize: {
order: 'asc',
caseInsensitive: true
}
caseInsensitive: true,
},
}
]
}
],
},
}
22 changes: 13 additions & 9 deletions eslint-config-base/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,32 @@
"name": "@jetrockets/eslint-config-base",
"version": "0.1.0",
"description": "Base config file",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"homepage": "https://github.com/jetrockets/eslint-config#readme",
"bugs": {
"url": "https://github.com/jetrockets/eslint-config/issues"
},
"repository": {
"type": "git",
"url": "git+https://github.com/jetrockets/eslint-config.git"
},
"author": "Maksim Romanov",
"license": "ISC",
"bugs": {
"url": "https://github.com/jetrockets/eslint-config/issues"
"author": "Maksim Romanov",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"homepage": "https://github.com/jetrockets/eslint-config#readme",
"dependencies": {
"@cspell/eslint-plugin": "^7.0.1",
"@html-eslint/eslint-plugin": "^0.19.1",
"@html-eslint/parser": "^0.19.1",
"eslint-config-standard": "^17.1.0",
"@cspell/eslint-plugin": "^7.0.1"
"eslint-import-resolver-custom-alias": "^1.3.2",
"eslint-plugin-import": "^2.28.1",
"eslint-plugin-json-format": "^2.0.1"
},
"devDependencies": {
"eslint": "^8.47.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-import": "^2.28.1",
"eslint-plugin-n": "^15.0.0 || ^16.0.0 ",
"eslint-plugin-promise": "^6.0.0"
}
Expand Down
Loading

0 comments on commit 874218a

Please sign in to comment.