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
42 changes: 0 additions & 42 deletions .eslintrc.json

This file was deleted.

36 changes: 30 additions & 6 deletions .github/workflows/integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,22 @@ jobs:
build:
strategy:
matrix:
angular-version: [9, 10, 11, 12, 13, 14, 15]
os: [ubuntu-latest, windows-latest]
include:
- angular-version: 16
node-version: 18
os: ubuntu-latest
- angular-version: 17
node-version: 18
os: ubuntu-latest
- angular-version: 18
node-version: 20
os: ubuntu-latest
- angular-version: 19
node-version: 20
os: ubuntu-latest
- angular-version: 20
node-version: 22
os: ubuntu-latest

runs-on: ${{ matrix.os }}
defaults:
Expand All @@ -31,7 +45,7 @@ jobs:
- name: 🏗 Setup node version
uses: actions/setup-node@v3
with:
node-version: 18
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
- run: |
pnpm install --frozen-lockfile
Expand Down Expand Up @@ -71,10 +85,20 @@ jobs:

- name: 🚁 Move test & config files into Angular Project Version ${{ matrix.angular-version }}
run: |
cp test/.eslintrc* tmp/angular${{ matrix.angular-version }}
cp test/.stylelintrc* tmp/angular${{ matrix.angular-version }}
cp test/eslint.config.js tmp/angular${{ matrix.angular-version }}
cp test/stylelint.config.js tmp/angular${{ matrix.angular-version }}
rm -rf tmp/angular${{ matrix.angular-version }}/src/app/*
cp test/src/* tmp/angular${{ matrix.angular-version }}/src/app
cd tmp/angular${{ matrix.angular-version }}/src/app
for f in *.ts.bak; do mv -- "$f" "${f%.bak}"; done
for f in *.css.bak; do mv -- "$f" "${f%.bak}"; done
cd -

- name: 🛠️ Patch package.json for ESM in Angular <= 17
if: ${{ matrix.angular-version <= 17 }}
run: |
cd tmp/angular${{ matrix.angular-version }}
jq '. + {"type": "module"}' package.json > package.json.tmp && mv package.json.tmp package.json

- name: 🚀 Run Linter in Angular Project Version ${{ matrix.angular-version }}
run: |
Expand All @@ -83,7 +107,7 @@ jobs:
pnpm exec ng lint > result.txt
set -e
cat result.txt
grep -Fx "✖ 5 problems (5 errors, 0 warnings)" result.txt && echo "SUCCESS=1" >> $GITHUB_ENV || echo "SUCCESS=0" >> $GITHUB_ENV
grep -Fx "✖ 15 problems (15 errors, 0 warnings)" result.txt && echo "SUCCESS=1" >> $GITHUB_ENV || echo "SUCCESS=0" >> $GITHUB_ENV

- name: Assert result
if: ${{ env.SUCCESS != 1 }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- name: 🏗 Setup node version
uses: actions/setup-node@v3
with:
node-version: 18
node-version: 22
cache: 'pnpm'

- name: 🏗 Install dependencies
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
18
22
32 changes: 6 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

# Angular ESLint + Stylelint Linter

[![npm version](https://badge.fury.io/js/@krema%2Fangular-eslint-stylelint-builder.svg)](https://badge.fury.io/js/@krema%2Fangular-eslint-stylelint-builder) ![node workflow](https://github.com/krema/angular-eslint-stylelint-builder/actions/workflows/integration-test.yml/badge.svg) ![node workflow](https://github.com/krema/angular-eslint-stylelint-builder/actions/workflows/unit-test.yml/badge.svg) ![angular versions](https://img.shields.io/badge/angular-v9--v15-%2523DD0031.svg?flat-square&logo=angular&labelColor=ff0000&color=grey)
Expand Down Expand Up @@ -160,41 +159,22 @@ You can configure the following options:
<td colspan="5"><b>File Enumeration:</b></td>
</tr>
<tr>
<td>eslintIgnorePath</td>
<td></td>
<td>eslintIgnorePatterns</td>
<td>[]</td>
<td>
A path to a file containing patterns describing files to ignore instead of
$CWD/.eslintignore
Array of glob patterns describing files to ignore (replaces <code>eslintIgnorePath</code> and <code>.eslintignore</code> in ESLint 9+)
</td>
<td></td>
<td>eslint</td>
</tr>
<tr>
<td>stylelintIgnorePath</td>
<td></td>
<td>
A path to a file containing patterns describing files to ignore instead of
$CWD/.stylelintignore
</td>
<td></td>
<td>stylelint</td>
</tr>
<tr>
<td>eslintRulesDir</td>
<td>stylelintIgnorePatterns</td>
<td>[]</td>
<td>
This option allows you to specify another directory from which to load
rules files
Array of glob patterns describing files to ignore (replaces <code>stylelintIgnorePath</code> and <code>.stylelintignore</code> in Stylelint 16+)
</td>
<td></td>
<td>eslint</td>
</tr>
<tr>
<td>eslintResolvePluginsRelativeTo</td>
<td></td>
<td>Changes the folder where plugins are resolved from</td>
<td></td>
<td>eslint</td>
<td>stylelint</td>
</tr>
<tr>
<td colspan="5"><b>Output:</b></td>
Expand Down
62 changes: 62 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
import js from "@eslint/js";
import tseslint from "@typescript-eslint/eslint-plugin";
import tsParser from "@typescript-eslint/parser";
import importPlugin from "eslint-plugin-import";
import prettierPlugin from "eslint-plugin-prettier";
import unusedImportsPlugin from "eslint-plugin-unused-imports";

export default [
js.configs.recommended,
{
files: ["**/*.ts"],
languageOptions: {
parser: tsParser,
parserOptions: {
project: [
"tsconfig.json",
"tsconfig.lib.json",
"tsconfig.spec.json"
],
createDefaultProgram: false,
ecmaVersion: 2022,
sourceType: "module"
},
globals: {
NodeJS: "readonly",
describe: "readonly",
it: "readonly",
beforeEach: "readonly",
afterEach: "readonly",
expect: "readonly",
jest: "readonly",
console: "readonly",
process: "readonly"
}
},
plugins: {
"@typescript-eslint": tseslint,
"unused-imports": unusedImportsPlugin,
"prettier": prettierPlugin,
"import": importPlugin
},
rules: {
"prettier/prettier": "error",
"@typescript-eslint/consistent-type-imports": "error",
"@typescript-eslint/no-unused-vars": [
"error",
{
argsIgnorePattern: "_"
}
],
"@typescript-eslint/array-type": "error",
"@typescript-eslint/ban-ts-comment": "off",
"no-else-return": "error",
"semi": ["error", "always"]
},
settings: {
"import/resolver": {
typescript: {}
}
}
}
];
13 changes: 12 additions & 1 deletion jest.config.js → jest.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,19 @@ module.exports = {
preset: 'ts-jest',
roots: ['lib'],
testEnvironment: 'node',
testPathIgnorePatterns: ['test-project', 'out'],
testPathIgnorePatterns: ['test-project'],
testLocationInResults: true,
reporters: ['default'],
setupFilesAfterEnv: ['jest-extended/all'],
transform: {
'^.+\\.tsx?$': [
'ts-jest',
{
tsconfig: 'tsconfig.spec.json',
},
],
},
transformIgnorePatterns: [
'/node_modules/'
],
};
Loading
Loading