Skip to content

Commit

Permalink
Convert to new flat config for eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
dpilafian committed Aug 14, 2024
1 parent 775b413 commit 75b198e
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 31 deletions.
22 changes: 22 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// @ts-check

import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';

export default [
eslint.configs.recommended,
...tseslint.configs.strictTypeChecked,
{ ignores: ['**/*.js'] },
{
languageOptions: { parserOptions: { projectService: true } },
rules: {
'@typescript-eslint/no-confusing-void-expression': 'off', //prefer minimal arrow functions
'@typescript-eslint/no-floating-promises': 'off', //annimations may be fire-and-forget
'@typescript-eslint/no-misused-promises': 'off', //annimations may be fire-and-forget
'@typescript-eslint/no-non-null-assertion': 'off', //ts cannot always know value exists
'@typescript-eslint/restrict-template-expressions': 'off', //numbers in templates are natural
'@typescript-eslint/unbound-method': 'off', //safer to not use 'this'
'@typescript-eslint/use-unknown-in-catch-callback-variable': 'off', //clarity over theoretical exceptions
},
},
];
43 changes: 12 additions & 31 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,32 +44,13 @@
"node": true,
"mocha": true
},
"eslintConfig": {
"ignorePatterns": [
"build",
"dist",
"node_modules"
],
"root": true,
"parser": "@typescript-eslint/parser",
"plugins": [
"@typescript-eslint"
],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended"
],
"rules": {
"@typescript-eslint/no-non-null-assertion": "off"
}
},
"runScriptsConfig": {
"clean": [
"rimraf build dist"
],
"lint": [
"jshint . --exclude-path .gitignore",
"eslint --max-warnings 0 src --ext .ts"
"eslint --max-warnings 0"
],
"build": [
"tsc",
Expand Down Expand Up @@ -98,28 +79,28 @@
"examples": "npm test && node spec/examples.js"
},
"devDependencies": {
"@eslint/js": "~9.3",
"@fortawesome/fontawesome-free": "~6.5",
"@types/node": "~20.12",
"@eslint/js": "~9.9",
"@fortawesome/fontawesome-free": "~6.6",
"@types/node": "~22.2",
"add-dist-header": "~1.4",
"assert-deep-strict-equal": "~1.2",
"copy-file-util": "~1.2",
"copy-folder-util": "~1.1",
"csso-cli": "~4.0",
"dna-engine": "~3.2",
"eslint": "8.57.0",
"eslint": "~9.9",
"esm-to-plain-js": "~1.1",
"fetch-json": "~3.3",
"jsdom": "~24.1",
"jshint": "~2.13",
"mocha": "~10.4",
"mocha": "~10.7",
"replacer-util": "~1.3",
"rimraf": "~5.0",
"run-scripts-util": "~1.2",
"typescript": "~5.4",
"typescript-eslint": "~7.11",
"uglify-js": "~3.17",
"rimraf": "~6.0",
"run-scripts-util": "~1.3",
"typescript": "~5.5",
"typescript-eslint": "~8.1",
"uglify-js": "~3.19",
"w3c-html-validator": "~1.8",
"web-ignition": "~2.1"
"web-ignition": "~2.2"
}
}

0 comments on commit 75b198e

Please sign in to comment.