Skip to content

Commit

Permalink
Merge pull request #258 from editor-js/eslint
Browse files Browse the repository at this point in the history
Update ESLint config & lint code
  • Loading branch information
dependentmadani authored Jul 30, 2024
2 parents de05642 + f4b8bc6 commit 5d1c57c
Show file tree
Hide file tree
Showing 12 changed files with 716 additions and 745 deletions.
8 changes: 0 additions & 8 deletions .eslintrc

This file was deleted.

48 changes: 48 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import Codex from "eslint-config-codex";
import { plugin as TsPlugin, parser as TsParser } from 'typescript-eslint';

export default [
...Codex,
{
files: ['src/**/*.ts'],
languageOptions: {
parser: TsParser,
parserOptions: {
project: './tsconfig.json',
tsconfigRootDir: './',
sourceType: 'module',
},
},
rules: {
'n/no-missing-import': ['off'],
'n/no-unsupported-features/node-builtins': ['off'],
'jsdoc/require-returns-description': ['off'],
"@typescript-eslint/naming-convention": [
"error",
{
"selector": "variable",
"format": ["camelCase"],
"leadingUnderscore": "allow"
},
],
"@typescript-eslint/ban-types": ["error",
{
"types": {
"String": true,
"Boolean": true,
"Number": true,
"Symbol": true,
"{}": false,
"Object": true,
"object": false,
"Function": false,
},
"extendDefaults": true
}
]
}
},
{
ignores: ['dev/**', 'eslint.config.mjs', 'vite.config.js', 'postcss.config.js']
}
];
15 changes: 8 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@editorjs/image",
"version": "2.9.2",
"version": "2.9.3",
"keywords": [
"codex editor",
"image",
Expand All @@ -26,9 +26,9 @@
"scripts": {
"dev": "vite",
"build": "vite build",
"lint": "eslint src/ --ext .ts",
"lint:errors": "eslint src/ --quiet",
"lint:fix": "eslint src/ --fix"
"lint": "eslint",
"lint:errors": "eslint --quiet",
"lint:fix": "eslint --fix"
},
"author": {
"name": "CodeX",
Expand All @@ -37,16 +37,17 @@
"devDependencies": {
"@codexteam/ajax": "^4.2.0",
"@editorjs/editorjs": "2.30.0-rc.12",
"@typescript-eslint/eslint-plugin": "^7.13.1",
"@typescript-eslint/parser": "^7.13.1",
"eslint": "^7.22.0",
"@typescript-eslint/eslint-plugin": "^7.16.1",
"@typescript-eslint/parser": "^7.16.1",
"eslint": "^9.7.0",
"eslint-config-codex": "^2.0.1",
"eslint-loader": "^4.0.2",
"formidable": "^3.5.1",
"postcss-nested": "^6.0.1",
"postcss-nested-ancestors": "^3.0.0",
"request": "^2.88.0",
"typescript": "^5.4.5",
"typescript-eslint": "^7.17.0",
"vite": "^5.3.1",
"vite-plugin-css-injected-by-js": "^3.5.1",
"vite-plugin-dts": "^3.9.1"
Expand Down
Loading

0 comments on commit 5d1c57c

Please sign in to comment.