Skip to content

Commit

Permalink
Addition of eslint-plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
bafolts committed Nov 2, 2019
1 parent c7a417d commit 1aaf298
Show file tree
Hide file tree
Showing 12 changed files with 9,467 additions and 7,772 deletions.
15,589 changes: 7,817 additions & 7,772 deletions common/config/rush/yarn.lock

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions eslint-plugin/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// This is a workaround for https://github.com/eslint/eslint/issues/3458
require("@rushstack/eslint-config/patch-eslint6");

module.exports = {
extends: [ "@rushstack/eslint-config" ],
parserOptions: { tsconfigRootDir: __dirname },
};
25 changes: 25 additions & 0 deletions eslint-plugin/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Ignore everything by default
**

# Use negative patterns to bring back the specific things we want to publish
!/bin/**
!/lib/**
!/dist/**
!ThirdPartyNotice.txt

# Ignore certain files in the above folder
/dist/*.stats.*
/lib/**/test/*
/lib/**/__tests__/*

# NOTE: These don't need to be specified, because NPM includes them automatically.
#
# package.json
# README (and its variants)
# CHANGELOG (and its variants)
# LICENSE / LICENCE

## Project specific definitions
# -----------------------------

# (Add your exceptions here)
2 changes: 2 additions & 0 deletions eslint-plugin/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
registry=https://registry.npmjs.org/
always-auth=false
22 changes: 22 additions & 0 deletions eslint-plugin/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Copyright (c) Microsoft Corporation. All rights reserved.

MIT License

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
35 changes: 35 additions & 0 deletions eslint-plugin/build.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
'use strict';

const child_process = require('child_process');
const path = require('path');

const production = process.argv.indexOf('--production') >= 0;
const baseDir = __dirname;

process.chdir(baseDir);

process.exitCode = 1;
try {
child_process.execSync(path.join(baseDir, 'node_modules/.bin/rimraf')
+ ' ./lib/', { stdio: 'inherit' });

console.log('-- TYPESCRIPT --\n');
child_process.execSync(path.join(baseDir, 'node_modules/.bin/tsc'), { stdio: 'inherit' });

console.log('-- ESLINT --\n');
child_process.execSync(path.join(baseDir, 'node_modules/.bin/eslint')
+ ' -f unix \"src/**/*.{ts,tsx}\"',
{ stdio: 'inherit' });

if (production) {
console.log('-- TEST --\n');

child_process.execSync(path.join(baseDir, 'lib/tests/index'), {
stdio: [ 0, 1, 1 ]
});
}

process.exitCode = 0;
} catch (e) {
console.log('ERROR: ' + e.message);
}
Loading

0 comments on commit 1aaf298

Please sign in to comment.