Skip to content

Commit

Permalink
updated ESLint to flat file format
Browse files Browse the repository at this point in the history
  • Loading branch information
luth1um committed May 31, 2024
1 parent fb4b2e1 commit 7bc79a1
Show file tree
Hide file tree
Showing 6 changed files with 6,609 additions and 5,506 deletions.
50 changes: 0 additions & 50 deletions .eslintrc.json

This file was deleted.

9 changes: 5 additions & 4 deletions cypress/support/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,27 @@
// ***********************************************************

// Import commands.js using ES2015 syntax:
import './commands'
import './commands';

// Alternatively you can use CommonJS syntax:
// require('./commands')

import { mount } from 'cypress/angular'
import { mount } from 'cypress/angular';

// Augment the Cypress namespace to include type definitions for
// your custom command.
// Alternatively, can be defined in cypress/support/component.d.ts
// with a <reference path="./component" /> at the top of your spec.
declare global {
// eslint-disable-next-line @typescript-eslint/no-namespace
namespace Cypress {
interface Chainable {
mount: typeof mount
mount: typeof mount;
}
}
}

Cypress.Commands.add('mount', mount)
Cypress.Commands.add('mount', mount);

// Example use:
// cy.mount(MyComponent)
39 changes: 39 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import js from "@eslint/js";
import tseslint from "typescript-eslint";
import angular from "angular-eslint";

export default tseslint.config(
js.configs.recommended,
...tseslint.configs.recommended,
{
files: ["**/*.ts"],
extends: [...angular.configs.tsRecommended],
processor: angular.processInlineTemplates,
rules: {
"@angular-eslint/directive-selector": [
"error",
{
type: "attribute",
prefix: "solve",
style: "camelCase",
},
],
"@angular-eslint/component-selector": [
"error",
{
type: "element",
prefix: "solve",
style: "kebab-case",
},
],
},
},
{
files: ["**/*.html"],
extends: [...angular.configs.templateRecommended],
},
{
// needs to be in its own object to act as global ignore
ignores: ["dist", "karma.conf.js", ".angular"],
}
);
15 changes: 5 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"watch": "ng build --watch --configuration development",
"test": "ng test",
"test-once": "ng test --no-watch --no-progress --browsers=ChromeHeadlessCI",
"lint": "ng lint",
"lint": "eslint . --fix --max-warnings 0",
"e2e": "ng e2e",
"cypress:open": "cypress open",
"cypress:run": "cypress run"
Expand Down Expand Up @@ -41,19 +41,13 @@
"@angular-devkit/build-angular": "18.0.2",
"@angular-devkit/core": "18.0.2",
"@angular-devkit/schematics": "18.0.2",
"@angular-eslint/builder": "18.0.1",
"@angular-eslint/eslint-plugin": "18.0.1",
"@angular-eslint/eslint-plugin-template": "18.0.1",
"@angular-eslint/schematics": "18.0.1",
"@angular-eslint/template-parser": "18.0.1",
"@angular/cli": "18.0.2",
"@angular/compiler-cli": "18.0.1",
"@cypress/schematic": "2.5.1",
"@types/jasmine": "5.1.4",
"@typescript-eslint/eslint-plugin": "7.11.0",
"@typescript-eslint/parser": "7.11.0",
"angular-eslint": "18.0.1",
"cypress": "13.10.0",
"eslint": "8.57.0",
"eslint": "9.3.0",
"gh-pages": "6.1.1",
"jasmine-core": "5.1.2",
"karma": "6.4.3",
Expand All @@ -62,7 +56,8 @@
"karma-jasmine": "5.1.0",
"karma-jasmine-html-reporter": "2.1.0",
"rimraf": "5.0.7",
"typescript": "5.4.5"
"typescript": "5.4.5",
"typescript-eslint": "7.11.0"
},
"resolutions": {
"axios": "1.6.5",
Expand Down
Loading

0 comments on commit 7bc79a1

Please sign in to comment.