Skip to content

Update dependencies (ESLint v9 and test libraries) #600

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open
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
261 changes: 0 additions & 261 deletions .eslintrc.yaml

This file was deleted.

8 changes: 8 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: npm ci
- run: npm test
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ pids
lib-cov

# Coverage directory used by tools like istanbul
coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt
Expand All @@ -29,3 +29,4 @@ node_modules

#project files
.idea

6 changes: 0 additions & 6 deletions .travis.yml

This file was deleted.

3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
[![Npm dependencies](https://img.shields.io/david/Gillespie59/eslint-plugin-angular.svg)](https://david-dm.org/Gillespie59/eslint-plugin-angular)
[![devDependency Status](https://img.shields.io/david/dev/Gillespie59/eslint-plugin-angular.svg)](https://david-dm.org/Gillespie59/eslint-plugin-angular#info=devDependencies)
[![Join the chat at https://gitter.im/Gillespie59/eslint-plugin-angular](https://img.shields.io/gitter/room/nwjs/nw.js.svg)](https://gitter.im/Gillespie59/eslint-plugin-angular?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Coverage Status](https://img.shields.io/coveralls/Gillespie59/eslint-plugin-angular/master.svg)](https://coveralls.io/r/Gillespie59/eslint-plugin-angular?branch=master)

## Summary

Expand Down Expand Up @@ -219,7 +218,7 @@ There are some useful references for creating new rules. Specificly useful are:

* [The Context Object](http://eslint.org/docs/developer-guide/working-with-rules#the-context-object) - This is the most basic understanding needed for adding or modifying a rule.
* [Options Schemas](http://eslint.org/docs/developer-guide/working-with-rules#options-schemas) - This is the preferred way for validating configuration options.
* [Scope](http://estools.github.io/escope/Scope.html) - This is the scope object returned by `context.getScope()`.
* [Scope](http://estools.github.io/escope/Scope.html) - This is the scope object returned by `context.sourceCode.getScope()`.

### Files you have to create

Expand Down
1 change: 0 additions & 1 deletion docs/rules/function-type.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
Anonymous or named functions inside AngularJS components.
The first parameter sets which type of function is required and can be 'named' or 'anonymous'.
The second parameter is an optional list of angular object names.
The third parameter is an optional list of reserved callee object name, default value is ['_'] to avoid false positive with lodash.

**Rule based on Angular 1.x**

Expand Down
24 changes: 24 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
const js = require("@eslint/js");
const globals = require("globals");

module.exports = [
js.configs.recommended,
{
rules: {
'indent': [2, 4, { SwitchCase: 1 }],
'no-prototype-builtins': 0,
'no-useless-escape': 0
}
},
{
ignores: ['examples/']
},
{
languageOptions: {
globals: {
...globals.mocha,
...globals.node,
},
},
},
];
26 changes: 1 addition & 25 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,37 +1,13 @@
'use strict';

var gulp = require('gulp');
var eslint = require('gulp-eslint');
var istanbul = require('gulp-istanbul');
var mocha = require('gulp-mocha');
var docs = require('./scripts/docs.js');


gulp.task('quality', function() {
return gulp.src(['*.js', '{rules,test,scripts}/**/*.js'])
.pipe(eslint())
.pipe(eslint.format())
.pipe(eslint.failAfterError());
});

gulp.task('test', function(cb) {
gulp.src(['index.js', 'rules/**/*.js'])
.pipe(istanbul()) // Covering files
.pipe(istanbul.hookRequire()) // Force `require` to return covered files
.on('finish', function() {
gulp.src(['test/**/*.js'])
.pipe(mocha())
.pipe(istanbul.writeReports()) // Creating the reports after tests runned
.on('end', cb);
});
});


gulp.task('docs', function(done) {
docs.updateReadme('README.md');
docs.createDocFiles();
// docs.testDocs(cb);
done();
});

gulp.task('default', gulp.series('quality', 'docs', 'test'));
gulp.task('default', gulp.series('docs'));
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

/* eslint-disable global-require */

var fs = require('fs');
var path = require('path');
Expand Down
Loading