diff --git a/apps/update/eslint.config.js b/apps/update/eslint.config.js deleted file mode 100644 index 43329dea..00000000 --- a/apps/update/eslint.config.js +++ /dev/null @@ -1,464 +0,0 @@ -// TODO: switch to typescript https://github.com/eslint/eslint/pull/18134 - -import eslint from '@eslint/js'; -import tseslint from 'typescript-eslint'; -import stylistic from '@stylistic/eslint-plugin'; -// import stylisticRules from '@stylistic/eslint-plugin/rule-options'; -import jsdoc from 'eslint-plugin-jsdoc'; - - -export default tseslint.config( - { - languageOptions: { - parserOptions: { - project: true, - tsconfigDirName: import.meta.dirname, - }, - }, - - plugins: { - jsdoc, - // @ts-expect-error this works - '@stylistic': stylistic, // as typeof stylisticRules, - }, - - extends: [ - eslint.configs.recommended, - jsdoc.configs['flat/recommended-typescript'], - ...tseslint.configs.recommended, - ], - - rules: { - // JSDoc settings - 'jsdoc/tag-lines': ['warn', 'any', { startLines: 1 }], - 'jsdoc/check-line-alignment': ['warn', 'always', { - tags: ['param', 'arg', 'argument', 'property', 'prop'], - }], - - // Newer settings - '@typescript-eslint/no-extraneous-class': ['off'], - '@typescript-eslint/no-implied-eval': ['off'], - - // Pre-flat config - '@typescript-eslint/no-unused-vars': [ - 'error', - { - args: 'all', - argsIgnorePattern: '^_', - caughtErrors: 'all', - caughtErrorsIgnorePattern: '^_', - destructuredArrayIgnorePattern: '^_', - varsIgnorePattern: '^_', - ignoreRestSiblings: true, - }, - ], - - 'array-callback-return': [ - 'error', - { - allowImplicit: true, - checkForEach: true, - }, - ], - 'no-constructor-return': [ - 'error', - ], - 'no-unreachable-loop': [ - 'error', - { - ignore: [ - 'ForInStatement', - 'ForOfStatement', - ], - }, - ], - 'no-use-before-define': [ - 'error', - { - functions: false, - }, - ], - 'block-scoped-var': [ - 'error', - ], - 'class-methods-use-this': [ - 'error', - ], - 'curly': [ - 'warn', - ], - 'default-case-last': [ - 'warn', - ], - 'default-param-last': [ - 'error', - ], - 'eqeqeq': [ - 'error', - 'smart', - ], - 'func-names': [ - 'warn', - 'never', - ], - 'func-style': [ - 'warn', - 'expression', - ], - 'logical-assignment-operators': [ - 'warn', - 'always', - ], - 'no-array-constructor': [ - 'error', - ], - 'no-empty-function': [ - 'warn', - ], - 'no-empty-static-block': [ - 'warn', - ], - 'no-extend-native': [ - 'error', - ], - 'no-extra-bind': [ - 'warn', - ], - 'no-implicit-coercion': [ - 'warn', - ], - 'no-iterator': [ - 'error', - ], - 'no-labels': [ - 'error', - ], - 'no-lone-blocks': [ - 'error', - ], - 'no-lonely-if': [ - 'error', - ], - 'no-loop-func': [ - 'error', - ], - 'no-magic-numbers': [ - 'error', - { - ignore: [ - -1, - 0.1, - 0, - 1, - 2, - 3, - 4, - 5, - 10, - 12, - 33, - 66, - 100, - 255, - 360, - 450, - 500, - 1000, - ], - ignoreDefaultValues: true, - ignoreClassFieldInitialValues: true, - }, - ], - 'no-multi-assign': [ - 'error', - ], - 'no-new-wrappers': [ - 'error', - ], - 'no-object-constructor': [ - 'error', - ], - 'no-proto': [ - 'error', - ], - 'no-return-assign': [ - 'error', - ], - 'no-sequences': [ - 'error', - ], - 'no-shadow': [ - 'error', - { - builtinGlobals: true, - allow: [ - 'Window', - ], - }, - ], - 'no-undef-init': [ - 'warn', - ], - 'no-undefined': [ - 'error', - ], - 'no-useless-constructor': [ - 'warn', - ], - 'no-useless-escape': [ - 'off', - ], - 'no-useless-return': [ - 'error', - ], - 'no-var': [ - 'error', - ], - 'no-void': [ - 'off', - ], - 'no-with': [ - 'error', - ], - 'object-shorthand': [ - 'error', - 'always', - ], - 'one-var': [ - 'error', - 'never', - ], - 'operator-assignment': [ - 'warn', - 'always', - ], - 'prefer-arrow-callback': [ - 'error', - ], - 'prefer-const': [ - 'error', - ], - 'prefer-object-has-own': [ - 'error', - ], - 'prefer-regex-literals': [ - 'error', - ], - 'prefer-template': [ - 'warn', - ], - 'no-prototype-builtins': 'off', - '@typescript-eslint/no-var-requires': [ - 'off', - ], - '@stylistic/array-bracket-newline': [ - 'warn', - 'consistent', - ], - '@stylistic/array-bracket-spacing': [ - 'warn', - 'never', - ], - '@stylistic/arrow-parens': [ - 'warn', - 'always', - ], - '@stylistic/brace-style': [ - 'warn', - 'stroustrup', - ], - '@stylistic/comma-dangle': [ - 'warn', - 'always-multiline', - ], - '@stylistic/comma-spacing': [ - 'warn', - { - before: false, - after: true, - }, - ], - '@stylistic/comma-style': [ - 'error', - 'last', - ], - '@stylistic/dot-location': [ - 'error', - 'property', - ], - '@stylistic/function-call-argument-newline': [ - 'warn', - 'consistent', - ], - '@stylistic/function-paren-newline': [ - 'warn', - 'consistent', - ], - '@stylistic/indent': [ - 'warn', - 4, - { - SwitchCase: 1, - ignoreComments: true, - ignoredNodes: ['TemplateLiteral > *'], - }, - ], - '@stylistic/key-spacing': [ - 'warn', - { - beforeColon: false, - afterColon: true, - }, - ], - '@stylistic/keyword-spacing': [ - 'warn', - { - before: true, - }, - ], - '@stylistic/linebreak-style': [ - 'error', - 'unix', - ], - '@stylistic/lines-between-class-members': [ - 'warn', - 'always', - { - exceptAfterSingleLine: true, - }, - ], - '@stylistic/max-len': [ - 'warn', - { - code: 105, - ignoreComments: true, - ignoreTrailingComments: true, - ignoreUrls: true, - }, - ], - '@stylistic/multiline-ternary': [ - 'warn', - 'always-multiline', - ], - '@stylistic/new-parens': [ - 'error', - ], - '@stylistic/no-mixed-operators': [ - 'warn', - ], - '@stylistic/no-mixed-spaces-and-tabs': [ - 'error', - ], - '@stylistic/no-multi-spaces': [ - 'error', - ], - '@stylistic/no-tabs': [ - 'error', - ], - '@stylistic/no-trailing-spaces': [ - 'error', - ], - '@stylistic/no-whitespace-before-property': [ - 'warn', - ], - '@stylistic/nonblock-statement-body-position': [ - 'error', - 'below', - ], - '@stylistic/object-curly-newline': [ - 'warn', - { - consistent: true, - }, - ], - '@stylistic/object-curly-spacing': [ - 'warn', - 'always', - ], - '@stylistic/operator-linebreak': [ - 'warn', - 'after', - ], - '@stylistic/padded-blocks': [ - 'error', - 'never', - ], - '@stylistic/padding-line-between-statements': [ - 'warn', - { - blankLine: 'always', - prev: '*', - next: 'return', - }, - { - blankLine: 'always', - prev: [ - 'const', - 'let', - 'var', - ], - next: '*', - }, - { - blankLine: 'any', - prev: [ - 'const', - 'let', - 'var', - ], - next: [ - 'const', - 'let', - 'var', - ], - }, - { - blankLine: 'always', - prev: [ - 'case', - 'default', - ], - next: '*', - }, - ], - '@stylistic/quote-props': [ - 'error', - 'consistent-as-needed', - ], - '@stylistic/quotes': [ - 'error', - 'single', - { - avoidEscape: true, - }, - ], - '@stylistic/semi': [ - 'error', - 'always', - ], - '@stylistic/semi-spacing': [ - 'warn', - ], - '@stylistic/space-before-blocks': [ - 'warn', - ], - '@stylistic/space-before-function-paren': [ - 'warn', - 'never', - ], - '@stylistic/space-infix-ops': [ - 'warn', - ], - '@stylistic/spaced-comment': [ - 'warn', - 'always', - ], - '@stylistic/switch-colon-spacing': [ - 'warn', - ], - '@stylistic/wrap-regex': [ - 'warn', - ], - }, - }, -); diff --git a/apps/update/eslint.config.ts b/apps/update/eslint.config.ts new file mode 100644 index 00000000..f6bb50a7 --- /dev/null +++ b/apps/update/eslint.config.ts @@ -0,0 +1,451 @@ +import eslint from '@eslint/js'; +import jsdoc from 'eslint-plugin-jsdoc'; +import stylistic from '@stylistic/eslint-plugin'; +import tseslint from 'typescript-eslint'; + + +export default tseslint.config({ + files: ['**/*.js', '**/*.ts'], + ignores: ['node_modules/**', 'types/**'], + + extends: [ + eslint.configs.recommended, + jsdoc.configs['flat/recommended-typescript'], + stylistic.configs['recommended-flat'], + ...tseslint.configs.recommended, + ...tseslint.configs.stylistic, + ], + + rules: { + // JSDoc settings + 'jsdoc/tag-lines': ['warn', 'any', { startLines: 1 }], + 'jsdoc/check-line-alignment': ['warn', 'always', { + tags: ['param', 'arg', 'argument', 'property', 'prop'], + }], + 'jsdoc/no-types': 'off', + + // Newer settings + '@typescript-eslint/no-extraneous-class': ['off'], + '@typescript-eslint/no-implied-eval': ['off'], + 'class-methods-use-this': 'off', + '@stylistic/no-multiple-empty-lines': 'off', + + // Pre-flat config + '@typescript-eslint/no-unused-vars': [ + 'error', + { + args: 'all', + argsIgnorePattern: '^_', + caughtErrors: 'all', + caughtErrorsIgnorePattern: '^_', + destructuredArrayIgnorePattern: '^_', + varsIgnorePattern: '^_', + ignoreRestSiblings: true, + }, + ], + + 'array-callback-return': [ + 'error', + { + allowImplicit: true, + checkForEach: true, + }, + ], + 'no-constructor-return': [ + 'error', + ], + 'no-unreachable-loop': [ + 'error', + { + ignore: [ + 'ForInStatement', + 'ForOfStatement', + ], + }, + ], + 'no-use-before-define': [ + 'error', + { + functions: false, + }, + ], + 'block-scoped-var': [ + 'error', + ], + 'curly': [ + 'warn', + ], + 'default-case-last': [ + 'warn', + ], + 'default-param-last': [ + 'error', + ], + 'eqeqeq': [ + 'error', + 'smart', + ], + 'func-names': [ + 'warn', + 'never', + ], + 'func-style': [ + 'warn', + 'expression', + ], + 'logical-assignment-operators': [ + 'warn', + 'always', + ], + 'no-array-constructor': [ + 'error', + ], + 'no-empty-function': [ + 'warn', + ], + 'no-empty-static-block': [ + 'warn', + ], + 'no-extend-native': [ + 'error', + ], + 'no-extra-bind': [ + 'warn', + ], + 'no-implicit-coercion': [ + 'warn', + ], + 'no-iterator': [ + 'error', + ], + 'no-labels': [ + 'error', + ], + 'no-lone-blocks': [ + 'error', + ], + 'no-lonely-if': [ + 'error', + ], + 'no-loop-func': [ + 'error', + ], + 'no-magic-numbers': [ + 'error', + { + ignore: [ + -1, + 0.1, + 0, + 1, + 2, + 3, + 4, + 5, + 10, + 12, + 33, + 66, + 100, + 255, + 360, + 450, + 500, + 1000, + ], + ignoreDefaultValues: true, + ignoreClassFieldInitialValues: true, + }, + ], + 'no-multi-assign': [ + 'error', + ], + 'no-new-wrappers': [ + 'error', + ], + 'no-object-constructor': [ + 'error', + ], + 'no-proto': [ + 'error', + ], + 'no-return-assign': [ + 'error', + ], + 'no-sequences': [ + 'error', + ], + 'no-shadow': [ + 'error', + { + builtinGlobals: true, + allow: [ + 'Window', + ], + }, + ], + 'no-undef-init': [ + 'warn', + ], + 'no-undefined': [ + 'error', + ], + 'no-useless-constructor': [ + 'warn', + ], + 'no-useless-escape': [ + 'off', + ], + 'no-useless-return': [ + 'error', + ], + 'no-var': [ + 'error', + ], + 'no-void': [ + 'off', + ], + 'no-with': [ + 'error', + ], + 'object-shorthand': [ + 'error', + 'always', + ], + 'one-var': [ + 'error', + 'never', + ], + 'operator-assignment': [ + 'warn', + 'always', + ], + 'prefer-arrow-callback': [ + 'error', + ], + 'prefer-const': [ + 'error', + ], + 'prefer-object-has-own': [ + 'error', + ], + 'prefer-regex-literals': [ + 'error', + ], + 'prefer-template': [ + 'warn', + ], + 'no-prototype-builtins': 'off', + '@typescript-eslint/no-var-requires': [ + 'off', + ], + '@stylistic/array-bracket-newline': [ + 'warn', + 'consistent', + ], + '@stylistic/array-bracket-spacing': [ + 'warn', + 'never', + ], + '@stylistic/arrow-parens': [ + 'warn', + 'always', + ], + '@stylistic/brace-style': [ + 'warn', + 'stroustrup', + ], + '@stylistic/comma-dangle': [ + 'warn', + 'always-multiline', + ], + '@stylistic/comma-spacing': [ + 'warn', + { + before: false, + after: true, + }, + ], + '@stylistic/comma-style': [ + 'error', + 'last', + ], + '@stylistic/dot-location': [ + 'error', + 'property', + ], + '@stylistic/function-call-argument-newline': [ + 'warn', + 'consistent', + ], + '@stylistic/function-paren-newline': [ + 'warn', + 'consistent', + ], + '@stylistic/indent': [ + 'warn', + 4, + { + SwitchCase: 1, + ignoreComments: true, + ignoredNodes: ['TemplateLiteral > *'], + }, + ], + '@stylistic/key-spacing': [ + 'warn', + { + beforeColon: false, + afterColon: true, + }, + ], + '@stylistic/keyword-spacing': [ + 'warn', + { + before: true, + }, + ], + '@stylistic/linebreak-style': [ + 'error', + 'unix', + ], + '@stylistic/lines-between-class-members': [ + 'warn', + 'always', + { + exceptAfterSingleLine: true, + }, + ], + '@stylistic/max-len': [ + 'warn', + { + code: 105, + ignoreComments: true, + ignoreTrailingComments: true, + ignoreUrls: true, + }, + ], + '@stylistic/multiline-ternary': [ + 'warn', + 'always-multiline', + ], + '@stylistic/new-parens': [ + 'error', + ], + '@stylistic/no-mixed-operators': [ + 'warn', + ], + '@stylistic/no-mixed-spaces-and-tabs': [ + 'error', + ], + '@stylistic/no-multi-spaces': [ + 'error', + ], + '@stylistic/no-tabs': [ + 'error', + ], + '@stylistic/no-trailing-spaces': [ + 'error', + ], + '@stylistic/no-whitespace-before-property': [ + 'warn', + ], + '@stylistic/nonblock-statement-body-position': [ + 'error', + 'below', + ], + '@stylistic/object-curly-newline': [ + 'warn', + { + consistent: true, + }, + ], + '@stylistic/object-curly-spacing': [ + 'warn', + 'always', + ], + '@stylistic/operator-linebreak': [ + 'warn', + 'after', + ], + '@stylistic/padded-blocks': [ + 'error', + 'never', + ], + '@stylistic/padding-line-between-statements': [ + 'warn', + { + blankLine: 'always', + prev: '*', + next: 'return', + }, + { + blankLine: 'always', + prev: [ + 'const', + 'let', + 'var', + ], + next: '*', + }, + { + blankLine: 'any', + prev: [ + 'const', + 'let', + 'var', + ], + next: [ + 'const', + 'let', + 'var', + ], + }, + { + blankLine: 'always', + prev: [ + 'case', + 'default', + ], + next: '*', + }, + ], + '@stylistic/quote-props': [ + 'error', + 'consistent-as-needed', + ], + '@stylistic/quotes': [ + 'error', + 'single', + { + avoidEscape: true, + }, + ], + '@stylistic/semi': [ + 'error', + 'always', + ], + '@stylistic/semi-spacing': [ + 'warn', + ], + '@stylistic/space-before-blocks': [ + 'warn', + ], + '@stylistic/space-before-function-paren': [ + 'warn', + 'never', + ], + '@stylistic/space-infix-ops': [ + 'warn', + ], + '@stylistic/spaced-comment': [ + 'warn', + 'always', + ], + '@stylistic/switch-colon-spacing': [ + 'warn', + ], + '@stylistic/wrap-regex': [ + 'warn', + ], + }, +}); diff --git a/apps/update/package-lock.json b/apps/update/package-lock.json index ae873ef3..210cfc49 100644 Binary files a/apps/update/package-lock.json and b/apps/update/package-lock.json differ diff --git a/apps/update/package.json b/apps/update/package.json index d803e6be..0719ee6e 100644 --- a/apps/update/package.json +++ b/apps/update/package.json @@ -6,18 +6,16 @@ "scripts": { "build": "node_ver=$(node -v); esbuild src/app.ts --bundle --platform=node --target=\"node${node_ver:1:2}\" --outfile=out/bin/app.cjs" }, - "devDependencies": { - "@eslint/js": "9.7.0", - "@stylistic/eslint-plugin": "2.3.0", + "dependencies": { + "@eslint/js": "9.11.1", + "@stylistic/eslint-plugin": "2.8.0", "@types/eslint__js": "8.42.3", - "@types/node": "20.14.11", - "esbuild": "0.23.0", - "eslint": "9.7.0", - "eslint-plugin-jsdoc": "48.7.0", - "typescript": "5.5.3", - "typescript-eslint": "7.16.1" - }, - "overrides": { - "eslint": "$eslint" + "@types/node": "22.6.0", + "esbuild": "0.24.0", + "eslint": "9.11.1", + "eslint-plugin-jsdoc": "50.2.4", + "jiti": "1.21.6", + "typescript": "5.6.2", + "typescript-eslint": "8.7.0" } } diff --git a/apps/update/src/misc.ts b/apps/update/src/misc.ts index 00256117..502aa291 100644 --- a/apps/update/src/misc.ts +++ b/apps/update/src/misc.ts @@ -10,7 +10,7 @@ const FLAKE = process.env.FLAKE; export const updateFlakeInputs = () => { const output = spawnSync( `git restore flake.lock &> /dev/null; nix flake update --flake ${FLAKE}` + - ' |& grep -v "warning: updating lock file"', + ' |& grep -v "warning: updating lock file"', [], { shell: true }, ).stdout diff --git a/nixosModules/ags/config/package-lock.json b/nixosModules/ags/config/package-lock.json index 79ce4028..239aa943 100644 Binary files a/nixosModules/ags/config/package-lock.json and b/nixosModules/ags/config/package-lock.json differ diff --git a/nixosModules/ags/config/package.json b/nixosModules/ags/config/package.json index 83a8d22b..d5dd426a 100644 --- a/nixosModules/ags/config/package.json +++ b/nixosModules/ags/config/package.json @@ -4,15 +4,15 @@ "main": "config.js", "type": "module", "dependencies": { - "@eslint/js": "9.10.0", + "@eslint/js": "9.11.1", "@stylistic/eslint-plugin": "2.8.0", "@types/eslint__js": "8.42.3", - "@types/node": "22.5.4", - "eslint": "9.10.0", - "eslint-plugin-jsdoc": "50.2.2", + "@types/node": "22.6.0", + "eslint": "9.11.1", + "eslint-plugin-jsdoc": "50.2.4", "fzf": "0.5.2", "jiti": "1.21.6", "typescript": "5.6.2", - "typescript-eslint": "8.5.0" + "typescript-eslint": "8.7.0" } } diff --git a/nixosModules/ags/default.nix b/nixosModules/ags/default.nix index 3ccdf379..6229991a 100644 --- a/nixosModules/ags/default.nix +++ b/nixosModules/ags/default.nix @@ -104,7 +104,7 @@ in { ''; "${agsConfigDir}/config/node_modules".source = - buildNodeModules ./config "sha256-77AvDMxAtEJAFh8euStbTKLOQt6WQdgw+gjFeO5/fOA="; + buildNodeModules ./config "sha256-Xv8p7XfUoEJIDf3/78MG6xLoUBSobjmjYwzno+YzP8o="; } // (import ./icons.nix {inherit pkgs agsConfigDir;}) );