Permalink
Browse files

Drop babel (#2134)

Drop babel
  • Loading branch information...
1 parent bcf5600 commit 43df9d6aabca0969e4b2a648a177fce6dc605bf7 @davidtheclark davidtheclark committed on GitHub Nov 30, 2016
Showing 1,314 changed files with 63,567 additions and 66,526 deletions.
View
@@ -1,3 +1,2 @@
-dist
.nyc_output
decls
View
@@ -1,21 +1,22 @@
{
"extends": [
- "stylelint",
- "plugin:flowtype/recommended"
+ "stylelint"
],
+ "parserOptions": {
+ "ecmaVersion": 6,
+ "sourceType": "script"
+ },
"env": {
"jest": true
},
- "parser": "babel-eslint",
- "plugins": [
- "flowtype"
- ],
"rules": {
"arrow-spacing": 2,
"no-var": 2,
"object-shorthand": 2,
"prefer-const": 2,
"sort-imports": 2,
- "template-curly-spacing": 2
+ "template-curly-spacing": 2,
+ "strict": ["error", "global"],
+ "spaced-comment": 0
}
}
View
@@ -1,4 +1,3 @@
node_modules
-dist
*.log
.nyc_output
View
@@ -9,7 +9,7 @@ matrix:
script: npm run lint && npm run flow
env: CI=lint+flow
- node_js: '6'
- script: npm run jest
+ script: npm run jest-ci
env: CI=jest
- node_js: '7'
script: npm run test
View
@@ -0,0 +1,3 @@
+#!/usr/bin/env node
+
+require('../lib/cli');
@@ -78,7 +78,7 @@ In addition to the standard parsers mentioned in the ["Working on rules"](rules.
- [postcss-resolve-nested-selector](https://github.com/davidtheclark/postcss-resolve-nested-selector): Given a (nested) selector in a PostCSS AST, return an array of resolved selectors.
- [style-search](https://github.com/davidtheclark/style-search): Search CSS (and CSS-like) strings, with sensitivity to whether matches occur inside strings, comments, and functions.
-Have a look through [stylelint's internal utils](https://github.com/stylelint/stylelint/tree/master/src/utils) and if you come across one that you need in your plugin, then please consider helping us extract it out into a external module.
+Have a look through [stylelint's internal utils](https://github.com/stylelint/stylelint/tree/master/lib/utils) and if you come across one that you need in your plugin, then please consider helping us extract it out into a external module.
## Testing plugins
@@ -10,7 +10,7 @@ When developing plugins, you can use the following rule testers or create your o
- stylelint-test-rule-mocha
- stylelint-test-rule-ava
-The rule tester used within the stylelint codebase is at `src/testUtils/testRule.js`. (It is the same as `stylelint-test-rule-tape`.)
+The rule tester used within the stylelint codebase is at `lib/testUtils/testRule.js`. (It is the same as `stylelint-test-rule-tape`.)
## Using a rule tester
@@ -48,7 +48,7 @@ Required properties:
Optional properties:
- `syntax` {"css"|"less"|"scss"|"sugarss"}: Defaults to `"css"`. Other settings use special parsers.
-- `skipBasicChecks` {boolean}: Defaults to `false`. If `true`, a few rudimentary checks (that should almost always be included) will not be performed. You can check those out in `src/testUtils/basicChecks.js`.
+- `skipBasicChecks` {boolean}: Defaults to `false`. If `true`, a few rudimentary checks (that should almost always be included) will not be performed. You can check those out in `lib/testUtils/basicChecks.js`.
- `preceedingPlugins` {array}: An array of PostCSS plugins that should be run before the CSS is tested.
## Creating a rule tester
@@ -98,7 +98,7 @@ You will use the simple [PostCSS API](http://api.postcss.org/) to navigate and a
Depending on the rule, we also recommend using [postcss-value-parser](https://github.com/TrySound/postcss-value-parser) and [postcss-selector-parser](https://github.com/postcss/postcss-selector-parser). There are significant benefits to using these parsers instead of regular expressions or `indexOf` searches (even if they aren't always the most performant method).
-stylelint has a number of [utility functions](https://github.com/stylelint/stylelint/tree/master/src/utils) that are used in existing rules and might prove useful to you, as well. Please look through those so that you know what's available. (And if you have a new function that you think might prove generally helpful, let's add it to the list!)
+stylelint has a number of [utility functions](https://github.com/stylelint/stylelint/tree/master/lib/utils) that are used in existing rules and might prove useful to you, as well. Please look through those so that you know what's available. (And if you have a new function that you think might prove generally helpful, let's add it to the list!)
In particular, you will definitely want to use `validateOptions()` so that users are warned about invalid options. (Looking at other rules for examples of options validation will help a lot.)
@@ -147,7 +147,7 @@ However, this runs all 25,000+ unit tests and also linting.
To run tests in a single file only (which you'll want to do during development), you'll need to use `babel-tape-runner` (because the codebase is ES6). For example, to run the test for the `color-hex-case` rule:
```console
-./node_modules/.bin/babel-tape-runner src/rules/color-hex-case/__tests__/index.js
+./node_modules/.bin/babel-tape-runner lib/rules/color-hex-case/__tests__/index.js
```
### Write the README
@@ -189,7 +189,7 @@ Take the form of:
The final step is to add references to the new rule in the following places:
-- [The rules `index.js` file](https://github.com/stylelint/stylelint/blob/master/src/rules/index.js)
+- [The rules `index.js` file](https://github.com/stylelint/stylelint/blob/master/lib/rules/index.js)
- [The list of rules](../user-guide/rules.md)
- [The example config](../user-guide/example-config.md)
@@ -39,7 +39,7 @@ postcss([
require("reporter")
])
.process(css, {
- from: "src/app.css",
+ from: "lib/app.css",
syntax: scss
})
})
@@ -101,7 +101,7 @@ var postcss = require("postcss")
var stylelint = require("stylelint")
// CSS to be processed
-var css = fs.readFileSync("src/app.css", "utf8")
+var css = fs.readFileSync("lib/app.css", "utf8")
postcss(
processors: [
@@ -114,7 +114,7 @@ postcss(
require("postcss-reporter")({ clearMessages: true })
]
)
- .process(css, { from: 'src/app.css', to: 'app.css' })
+ .process(css, { from: 'lib/app.css', to: 'app.css' })
.then(function (result) {
fs.writeFileSync('app.css', result.css);
if ( result.map ) fs.writeFileSync('app.css.map', result.map);
Oops, something went wrong.

0 comments on commit 43df9d6

Please sign in to comment.