Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 0 additions & 55 deletions .eslintrc.json

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: '22.19.0'
node-version: '24.16.0'
cache: 'npm'
- run: npm run ci:check-production-vulnerabilities
- name: Cache node modules
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-npmjs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '22.19.0'
node-version: '24.16.0'
cache: 'npm'
registry-url: 'https://registry.npmjs.org'
- name: Update npm
Expand Down
2 changes: 1 addition & 1 deletion .node-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
22.19
24.16
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v22.19
v24.16
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ After generating the new library make sure to:
- Make sure to expose the public components/classes/... by adding an export in the `public-api.ts` file of the library.
- Also add the new library in the `scripts/ci/build-libs.sh` to the LIBRARIES_LIST at line 4 in the file.
- Make sure the new lib is added to the `projects` in `angular.json`.
- Add `.eslintrc` to the library.
- Add the library to the `ppwcodeLibraries` list in `eslint.config.js`.
- Add library to `.github/workflows/publish-npmjs.yaml` to ensure it gets published to npmjs.

## Build
Expand Down
95 changes: 95 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
// @ts-check

const eslint = require('@eslint/js')
const { FlatCompat } = require('@eslint/eslintrc')
const angular = require('angular-eslint')
const noSecrets = require('eslint-plugin-no-secrets')
const tseslint = require('typescript-eslint')

const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: eslint.configs.recommended,
allConfig: eslint.configs.all
})

const noSecretsRule = {
'no-secrets/no-secrets': ['error', { tolerance: 4.3 }]
}

const angularSelectorRules = {
'@angular-eslint/directive-selector': [
'error',
{
type: 'attribute',
prefix: 'ppw',
style: 'camelCase'
}
],
'@angular-eslint/component-selector': [
'error',
{
type: 'element',
prefix: 'ppw',
style: 'kebab-case'
}
]
}

const ppwcodeLibraries = [
'ng-async',
'ng-common',
'ng-common-components',
'ng-dialogs',
'ng-forms',
'ng-router',
'ng-state-management',
'ng-unit-testing',
'ng-utils',
'ng-wireframe'
]

module.exports = tseslint.config(
{
ignores: ['dist/**/*', 'node_modules/**/*']
},
...compat.extends('plugin:depend/recommended'),
{
files: ['**/*.ts'],
extends: [eslint.configs.recommended, ...tseslint.configs.recommended, ...angular.configs.tsRecommended],
processor: angular.processInlineTemplates,
plugins: {
'no-secrets': noSecrets
},
rules: {
...angularSelectorRules,
'@angular-eslint/prefer-on-push-component-change-detection': ['error'],
...noSecretsRule
}
},
{
files: ['**/*.html'],
extends: [...angular.configs.templateRecommended, ...angular.configs.templateAccessibility],
plugins: {
'no-secrets': noSecrets
},
rules: {
...noSecretsRule
}
},
...ppwcodeLibraries.map((libraryName) => ({
files: [`projects/ppwcode/${libraryName}/**/*.ts`],
rules: {
'no-restricted-imports': [
'error',
{
paths: [
{
name: `@ppwcode/${libraryName}`,
message: `Use a relative import instead. Importing from @ppwcode/${libraryName} is not allowed inside this lib directory.`
}
]
}
]
}
}))
)
Loading
Loading